home *** CD-ROM | disk | FTP | other *** search
/ MacWorld UK 2000 March / MW_UK_2000_03.iso / Shareware World / Utilities / Text Processing / Alpha / Help / Alpha Manual < prev    next >
Encoding:
Text File  |  1999-07-26  |  107.6 KB  |  2,292 lines  |  [TEXT/ALFA]

  1.  
  2.         Copyright © 1990-1998 Pete Keleher. All Rights Reserved
  3.         The Tcl code is copyright its respective authors
  4.         
  5.         Please note: The manual is currently being updated. This
  6.         document is about 90% finished. Other parts of the documentation
  7.         still need a major overhaul.
  8.         
  9. Legal notice
  10. The Author(s) of this product are in no way liable for any direct or 
  11. indirect damage caused by the product.
  12.  
  13. You may freely copy and distribute Alpha, but please bear in mind that 
  14. Alpha is Shareware.  If you decide to keep it, please register your copy 
  15. by selecting 'Register' from the 'About…' dialog.
  16.  
  17.         Introduction
  18.  
  19. Alpha is a very powerful, multi-purpose text editor.
  20.  
  21. Alpha is multi-modal, which means it switches between different modes
  22. depending on which type of document you are editing. Everybody who has used
  23. Emacs knows about this concept. The idea with different modes is to change
  24. Alpha's behavior depending on which kind of text you're editing. For
  25. example if you're programming in C++ or editing a LaTeX document you want
  26. different features.
  27.  
  28. Alpha is very customizable. Much of Alpha's functionality is implemented in
  29. 'packages' or 'extensions'. The 'Config->Preferences->Menus And Features'
  30. and 'Config->Mode Prefs->Menus and Features' menu items let you see which
  31. items are installed, and lets you turn them on and off.
  32.  
  33. Alpha uses Dr. Ousterhout's Tool Command Language (Tcl) as an extension
  34. language. Many of the functions bound to keystrokes, as well as many of the
  35. functions in the menus, are written in Tcl. All the 'packages' or 
  36. 'extensions' just mentioned are all written in Tcl. Anybody who wants can 
  37. write new packages for Alpha! 
  38.  
  39. Of course, you don't have to learn Tcl to use Alpha. You can have lots of
  40. use of Alpha without knowing anything about Tcl. But if you want to become
  41. a real power user, you should consider trying it out. Then the
  42. possibilities of customizing Alpha are unlimited.
  43.  
  44. How to navigate the documention?
  45.  
  46. You can quickly jump between different sections of the manual by using the
  47. menu you find under the M icon at the right top of this window.
  48.  
  49. Also, Alpha supports a limited form of hypertext. Clicking on green
  50. underlined text executes a command associated with the underlined text,
  51. usually taking you to other documentation. Control-<period> will bring you
  52. back.
  53.  
  54. Alpha contains source from many places, but in particular I'm grateful to
  55. Ray Johnson and Tim Endres for their working on porting TCL to the mac, and
  56. to Tom Scavo and Tom Pollard for their Tcl code contributions. The
  57. following people have also provided considerable code and/or help debugging
  58. the one or two bugs Alpha has had: Masatsugu Nagata, Karl J. Smith, Eric
  59. Sink, David C. Black, Richard T. Austin, Henry Spencer, Vince Darley, Johan
  60. Linde, Tom Fetherston, Jon Guyer and Jerry Fowler.
  61.  
  62.  
  63.         Basic editing
  64.  
  65. The very basics for editing text with Alpha is the same as in any other 
  66. Mac application, but Alpha has a number of key shortcuts to speed up your 
  67. work, and a couple of features not found in similar applications.
  68. Emacs user will also be happy to know that many of the basic keybindings 
  69. used in Emacs are supported by Alpha. However, this requires that you 
  70. switch on the Emacs package. Read more in the file Emacs Help.
  71.  
  72. Moving the Cursor
  73. left-arrow                      backward character
  74. right-arrow                     forward character
  75. up-arrow                        previous-line
  76. down-arrow                      next-line
  77.  
  78. option-left-arrow               backward one word
  79. option-right-arrow              forward one word
  80.  
  81. command-left-arrow              beginning of line
  82. command-right-arrow             end of line
  83. command-up-arrow  or  'home'    beginning of window
  84. command-down-arrow  or  'end'   end of window
  85.  
  86. 'Page up'                       move one page backward
  87. 'Page down'                     move one page forward
  88.  
  89. Selecting Text
  90. shift-left-arrow                extend selection one char left
  91. shift-right-arrow               extend selection one char right
  92.  
  93. shift-up-arrow                  extend selection one line up
  94. shift-down-arrow                extend selection one line down
  95.  
  96. shift-option-left-arrow         extend selection one word left
  97. shift-option-right-arrow        extend selection one word right
  98.  
  99. control-h                       select next word
  100.  
  101. shift-command-left-arrow        select to beginning of line
  102. shift-command-right-arrow       select to end of line
  103.  
  104. command-B                       select smallest set of parentheses, braces, or 
  105. (Balance in Text menu)          brackets that encloses the current selection
  106.  
  107. double-clicking                 select a word
  108. triple-clicking                 select a line
  109.  
  110. Control-double-clicking on any type of parentheses or bracket selects from 
  111. the parentheses or bracket to its mate. Without the control key held down, 
  112. only the intervening text is selected.
  113.  
  114. Twiddle, Shifting Text
  115. The following functions are found in the Text menu.
  116. Twiddle (command-`)                  Exchange characters bracketing 
  117.                                      the selection point.
  118. Twiddle Words (command-option-`)     Exchange words bracketing the 
  119.                                      selection point.
  120.  
  121. Shift Left (command-[)               Shift selection left one tab.
  122. Shift Left Space (command-option-[)  Shift selection left one space.
  123. Shift Right (command-])              Shift selection right one tab.
  124. Shift Right Space (command-option-]) Shift selection right one space.
  125.  
  126. Drag and Drop editing
  127. Alpha supports drag and drop cut, copy, clear, and paste. To use this 
  128. feature, select some text, then move the cursor over the selected text. 
  129. The cursor should then turn into an open hand. Mouse down, and move the 
  130. cursor to the place you wish to paste the text. When the mouse is 
  131. released, the hilighted text is moved to the new location.
  132.  
  133. Option-mouse does a "copy" instead. You can also drag selections between 
  134. windows and to and from other applications, including the Finder. Text 
  135. dragged to the Finder is saved in a text clip file. Text can be deleted by 
  136. dragging it to the trash can.
  137.  
  138. You can also drag any text file to an Alpha window to insert the content 
  139. of the file in the window.
  140.  
  141. You MUST have system 7.5 or above or Apple's "Macintosh Drag And Drop" 
  142. extension installed. Get a copy from Apple or via Alpha's web page.
  143.  
  144. Rectangular Editing
  145. If the option key is pressed while the mouse is dragged, a rectangular 
  146. section of text is selected instead of the normal selection. This 
  147. rectangular selection may extend over multiple lines, but contains only 
  148. text between the column of the drag start and the column of the drag end. 
  149. The drag cannot end on a column or row less than the start. This selection 
  150. can be extended by option-shift-mouse, but not dragged further.
  151.  
  152. The rectangular selection can be deleted, copied, and pasted. This is very 
  153. useful for tables and arrays, such as in LaTeX. Usually, the operation will 
  154. be intuitive. However, if you use proportional fonts the selection may 
  155. appear ragged. If some of the line contain tabs, the result may not be want 
  156. you want. Converting tabs to spaces in the desired region before attempting 
  157. rectangular selection usually fixes the problems.
  158.  
  159. Fill Routines
  160.  
  161. The 'fill' and 'wrap' routines reformat text to specified line lengths. 
  162. This is useful in two case. First, word processors such as Microsoft Word 
  163. only insert carriage returns at the end of paragraphs. Secondly, while 
  164. typing and inserting text into pre-existing paragraphs, the line lengths 
  165. become unequal.
  166.  
  167. The 'wrap' routine handles word processor documents quickly by merely 
  168. inserting carriage returns as necessary to ensure all lines in the selected 
  169. region are shorter than specified by the preference 'Fill Column'. Alpha 
  170. asks the user if wrapping should be done whenever the user opens files that 
  171. have lines longer than 'Para Column' characters. This feature can be 
  172. defeated by including the word 'nowrap' anywhere on the first line.
  173.  
  174. The 'fill' routine goes further. Not only does it break lines, but it also
  175. coalesces lines to eliminate short lines. The routine works by stripping
  176. the relevant text of white space, then re-inserting white space and
  177. carriage returns so that no line extends past 'Fill Column' characters in
  178. length and begins with 'Left Fill Column' spaces characters.
  179.  
  180. The preferences 'Fill Column', 'Para Column', and 'Left Fill Column' can 
  181. all be set in the dialog "Config->Preferences->Text".
  182.  
  183. Both the fill and wrap routines come in two flavors, 'Fill/Wrap Paragraph' 
  184. and 'Fill/Wrap Region'. 
  185.  
  186. Fill Paragraph
  187. If there's a selection, then Alpha fills all paragraphs in that selection.
  188. If not then Alpha fills the paragraph surrounding the insertion point. The
  189. definition of a 'paragraph' may be mode dependent, but in Text mode it is
  190. the text between the closest empty lines. Fill Paragraph also uses an extra
  191. preference 'Double Spaces', which determines if an extra space after should
  192. be placed after the '.' at the end of each sentence. This preference is set
  193. in the dialog "Config->Preferences->Text".
  194. Fill Region
  195. If there's a selection, then Alpha fills all paragraphs in that selection.
  196. If not then Alpha fills the region between the insertion point and the mark.
  197. Wrap Paragraph
  198. Wrap the paragraph surrounding the insertion point.
  199. Wrap Region
  200. If there's a selection, then wrap the selection. If not then wrap the 
  201. region between the insertion point and the mark.
  202.  
  203.         User interface details
  204.  
  205. Alpha's interface has several non-standard features, which are described in 
  206. this section.
  207.  
  208. Horizontal scrollbar 
  209. You can remove the horizontal scrollbar from Alpha's windows in order to
  210. give you more real estate. You can later get the scrollbar back when you
  211. need it. The menu item Toggle Scrollbar in the Window menu inserts/removes
  212. the horizontal scrollbar. The default for subsequent windows is controlled
  213. via the preference 'Hor Scroll Bar' (look under
  214. "Config->Preferences->Window").
  215.  
  216. Dynamic menus
  217. Alpha uses dynamic menus. This means that some menu items are changed if 
  218. you hold down any of the modifier keys. Usually the option key is the one 
  219. which reveals the hidden menu items, but there are also a few items which are 
  220. revealed by holding down the control or shift keys. Try this out by pulling 
  221. down the File menu and holding down one of the option, control, or shift keys.
  222.  
  223. Tear-off menus
  224. Alpha's menus can be torn off from the menubar to make floating palettes 
  225. of them. Clicking on the buttons on the palettes performs the same action 
  226. as the corresponding menu item. Note that dynamic menu items are separated 
  227. into several buttons, one for each dynamic item.
  228.  
  229. If the torn off menu has submenus, there will be popup submenus on the 
  230. palette. The submenus can in turn be torn off from the palette (as well as 
  231. directly from the menu in the menubar).
  232.  
  233. If a torn off menu belong to a specific mode, the palette will 
  234. disappear/reappear whenever you change from/to that mode.
  235.  
  236. If you do not want to use tear-off menus, you can disable this feature by 
  237. unchecking 'Tearoff Menus' in the dialog "Config->Preferences->Appearance".
  238.  
  239. Bugs: 
  240. Buttons in the palettes are not disabled when the corresponding menu 
  241. items are.
  242. Torn off submenus belonging to a specific mode are not hidden when you 
  243. change from that mode, only the main menu.
  244.  
  245. Status bar
  246. The stripe across the bottom of the screen is a floating window which is 
  247. used to display short messages. This window is called the status bar. Some 
  248. functions also uses it to prompt for input of some text.
  249.  
  250. To the right of the status bar there are three menus.
  251. • Wrap menu. Shows if the lines in the current window are wrapped 
  252. automatically and if the wrapping is soft or not. See the Section 
  253. Text Wrapping for more information about text wrapping.
  254. • File Attributes menu. Shows various attributes of the current window 
  255. that can be changed. What "Mac", "Unix", "IBM", "MPW", "Think", and "None" 
  256. means are explained in the Section File formats.
  257. Read only lets you toggle if the current window can be edited or not.
  258. Show invisibles toggles if invisible characters are shown or not. This 
  259. affects all windows, not only the current one.
  260. Tab size opens a dialog which lets you set the tab size of the current 
  261. window, i.e. how many positions a tab uses.
  262. • Mode menu. Shows the current mode and allows it to be changed. 
  263.  
  264. Finally, to the very right of the status bar the current line and column 
  265. are displayed. Clicking opens a dialog that allows a specific line to be 
  266. found.
  267.  
  268. You can't make the status bar go away. However, it can be dragged if you 
  269. uncheck 'Lock Status' in the dialog "Config->Preferences->Window".
  270.  
  271. Funcs menu
  272. Above the vertical scrollbar on the right is an icon with curly braces 
  273. ('{}'). This is the so called "Funcs" menu. The content of this menu is 
  274. mode dependent, but for modes for programming languages it usually lists 
  275. function definitions of the the current window. Select a function in the 
  276. menu to jump to its definition in the window. Refer the mode specific help 
  277. files for details about the Funcs menu for a specific mode. The menu is 
  278. built when you press the braces, so it is always up-to-date. By default, 
  279. the content in this menu is sorted alphanumerically. This feature can be 
  280. turned off via the preference 'Sort Funcs Menu' in the dialog 
  281. "Config->Preferences->Appearance", making the menu appear faster on slower 
  282. machines.
  283.  
  284. Power user tip: cmd-opt-K will put up a listpick dialog of the content of 
  285. the '{}' menu. As this is usually alphabetical you can type the starting 
  286. letters of the index you want to go to.
  287.  
  288. Marks menu
  289. Below the funcs menu is the "Marks" menu, which pops up over the icon with 
  290. the large 'M'. The "Marks" menu lists all marks for the current window, and 
  291. allows them to be cleared or automatically created. Marks are a kind 
  292. bookmarks in a file and helps you navigate it. The marks are saved when you 
  293. save the file. Select an item in this menu to jump to the corresponding 
  294. mark in the window. Selecting 'Mark file' will generate marks for the 
  295. current window. Which marks are generated is mode dependent. Refer to the 
  296. mode specific help files for information about which marks are generated in 
  297. a specific mode. For an extended discussion about marks, see the Section 
  298. Marks.
  299.  
  300. Tip: ctrl-cmd-K will put up a listpick dialog with the current marks of 
  301. the file.
  302.  
  303. Icons 
  304. Above the Funcs menu is either nothing, a red disk icon, or a lock icon. 
  305. The red disk icon indicates that the window is unsaved; clicking on the 
  306. icon saves the window. The lock icon indicates that the window is 
  307. read-only; command-clicking toggles the lock icon. Note, however, that an 
  308. unsaved window cannot be made read-only.
  309.  
  310. Title bar
  311. Clicking on the window title pulls down a popup menu showing all containing 
  312. folders of the window's file. Selecting an item in this menu puts up a open 
  313. dialog in the selected folder. Selecting an item in the menu while holding 
  314. down the shift key opens the folder in the Finder instead of putting up a 
  315. file dialog.
  316.  
  317. Command-clicking on the title bar anywhere but right on the title pulls 
  318. downs the Mark menu. This is also the case you click on the edges of the 
  319. window. 
  320. Tip: Using the sides of the window lets you access a particular area of the 
  321. menu quicker as you can cmd-click in the approximate location of the menu 
  322. item you want to select.
  323.   
  324. Option-clicking on the title bar brings down a menu. The content of this
  325. menu is mode dependent, but not all modes will define the content of the
  326. menu. If that is the case, the menu will contain a list of all files and
  327. folders in the open window's folder. Selecting a file in the menu will open
  328. it. Selecting a folder will open the containing folder in the Finder. Note
  329. that for windows not saved to the disk there will be no menu with files.
  330. Even if the mode will create a menu when option-clicking the title bar, all
  331. files and folders in the window's folder may be added to the menu. This
  332. happens if the number of items in the menu created by the mode is less than
  333. what is specified by the preference 'Min Items In Title Popup' which you
  334. find in the dialog "Config->Preferences->Window".
  335.  
  336. Split-pane bar
  337. Above the vertical scrollbar, right under the Marks menu ('M') is a black 
  338. "split-pane" bar. Double-clicking or dragging the split-pane bar splits the 
  339. frontmost window into two separately scrollable panes. You can also use the 
  340. menu item 'Split Window' in the Window menu. Either pane can be edited, any 
  341. changes appear in both panes if they show the same text. Move from one pane 
  342. to the other by clicking in the pane or by typing control-x, then 'o'. Go 
  343. back to a single pane by either double-clicking again or dragging the bar 
  344. back to the top of the window.
  345.  
  346. Iconified windows
  347. Alpha can create small icons of the windows, which are ordered along the 
  348. right edge of your screen. 'Iconify' (ctrl-I) in the window menu creates an 
  349. icon of the frontmost window. If all windows are iconified it expands one 
  350. of the windows again.
  351.  
  352. Checking 'Iconify On Switch' in the dialog "Config->Preferences->Window" will 
  353. make Alpha do the following:
  354. • Iconify all open windows when you switch to another app.
  355. • Expand all windows, which were not iconified before switching from Alpha, 
  356. when switching back to Alpha.
  357.  
  358.         File formats
  359.         
  360. Alpha can read and write files stored in different formats. In the Save 
  361. as… dialog you can specify in which format a file should be written through 
  362. the popup menus State and Format.
  363. State popup menu
  364. 'State' allows you to specify how much extra information should be saved in 
  365. files that you use.
  366. MPW     Window position, current selection, tab sizes, and font 
  367.         information are saved every time you open and close the file.
  368. Think   Tab sizes, and font information are saved every time you open 
  369.         and close the file.
  370. None    No information is saved when you open and close the file.
  371. The state information is saved in the file's resource fork. It is saved 
  372. even if you don't modify the file. Saving this information does not change 
  373. the modification date of the file.
  374.  
  375. Note that if a given file already has mpw information in it when the file 
  376. is open, Alpha will always update that information when the file is closed. 
  377. Note also that marks are always saved in the resource fork whenever a 
  378. file is saved, regardless of the 'State'.
  379.  
  380. Format popup menu
  381. This menu specifies the way Alpha terminates lines. This to make it easier 
  382. to share files with other platforms as lines are terminated differently on 
  383. different platforms.
  384. Mac     Lines end with a carriage return.
  385. Unix    Lines end with linefeed.
  386. IBM     Lines end with both carriage return and linefeed. 
  387.             Typical, isn't it?          
  388. Alpha will transparently read and write all three of these formats. If you 
  389. are not sharing files with other platforms you don't have to worry about 
  390. the format and simply you the default Mac format. Note that if you are 
  391. going to be sharing files with a Unix or IBM machine, you probably don't 
  392. want anything in the resource fork, so you'd probably want to set 
  393. 'State' to 'None'.
  394.  
  395. Both the state and format for a file can be change through the File 
  396. attributes popup menu in the status bar.
  397.  
  398. The default Saved State can be changed in the dialog 
  399. "Config->Preferences->Window".
  400.  
  401. Open file dialog
  402. Alpha's open file dialog looks like the dialog in any other Mac application 
  403. except for three extra checkboxes at the bottom.
  404. Read only   Opens the file as read only. That a file is read-only file 
  405.             is indicated by a lock icon in the upper right corner of 
  406.             the window. Read-only status can be toggled by 
  407.             command-clicking on the icon. The default action for 
  408.             'space' and 'backspace' when a file is read-only is to page 
  409.             forward (closing at the bottom of the file) or backward.
  410. Projector Aware Projector is freeware version control software from Apple 
  411.             that is included in MPW. It also runs as a standalone 
  412.             application known as SourceServer. It relies on the existence 
  413.             of a 'ckid' resource in the files.
  414.  
  415.             "Projector aware" means that an application
  416.                 
  417.     must)   not remove this ckid resource if one exists (that means if an 
  418.             application saves a file by writing a new one, then delete the 
  419.             old and rename the new one it must also make sure to copy over 
  420.             an existing ckid-resource even if it uses just the data fork)
  421.     should) interpret this 'ckid' resource correctly to treat a file as 
  422.             read-only if the ckid resource says that the file is read-only 
  423.             and not only if the Finder locked flag is set.
  424.  
  425.             However, I don't know how Alpha behaves in these two points.
  426.  
  427.             Finally, a ckid resource can contain a third state between 
  428.             writable and read-only. This state is called MRO (modify read 
  429.             only). Being a strange term (IMHO) MRO means that a file has 
  430.             been modified locally but has not been checked out from the 
  431.             version control pool before.
  432.  
  433. All files   Allows Alpha to open any file rather than just text files. 
  434.             (Technically speaking: not only those with file type 'TEXT'.)
  435.  
  436. Paragraph format
  437. Word processors such as Microsoft Word and MacWrite only put carriage 
  438. returns at the end of paragraphs, so that they can wrap the paragraphs on 
  439. the fly. This is what is referred to as 'paragraph format'. Alpha does not 
  440. transparently convert to and from this format because there are valid 
  441. reasons why someone might want to edit a paragraph formatted file while not 
  442. in paragraph mode.
  443.  
  444. Therefore, when Alpha opens a paragraph-mode file, it asks the user whether 
  445. or not to remap it. Alpha assumes a file to be in paragraph mode if it 
  446. contains any line longer than the value of 'Para Column', which can be set 
  447. in the dialog "Config->Preferences->Text". Files can be mapped back to 
  448. paragraph mode by using 'Paragraph to Line' in the text menu.
  449.  
  450.         Modes
  451.  
  452. Alpha is made for editing text of many different kinds. Therefore Alpha can 
  453. switch between many different modes. When Alpha switch between the modes 
  454. some of Alpha's functionality changes to better help you to write the 
  455. particular kind of text you are editing. For example C++ mode is used to 
  456. edit code in the C++ programming language, and HTML mode is used for 
  457. editing web pages. Alpha comes with more than 25 modes, most of them being 
  458. modes for different programming languages. The default mode is called Text 
  459. mode and is used for editing plain text, like this manual for example. 
  460. Alpha also switches to Text mode when you open a new untitled window. See 
  461. the file Packages for a complete list of them and for links for help for 
  462. each of them. This section is only a general discussion about modes.
  463.  
  464. Simple examples of functionality which changes between the modes are:
  465. • Coloring of the text. Programming language all have special keywords. 
  466. Alpha colors these keywords to make the code easier to read, and these words 
  467. are naturally different in different programming languages.
  468. • Alpha indents the code to make it easier to read. This is also naturally 
  469. done differently for different programming languages.
  470.  
  471. Most modes also add functionality to Alpha, functionality which is not 
  472. available for the basic Text mode. Some modes also have there own menu(s) 
  473. which are inserted in the menu bar when switches to the mode in question. 
  474. This menu(s) are removed again when Alpha leaves the mode. Some simple 
  475. examples of extra functionality in different modes:
  476. • In C++ mode Alpha can help you to quickly type certain language 
  477. constructs, such as for loops.
  478. • In HTML mode there is a function to create a link between two web pages.
  479.  
  480. It is important to know that Alpha has both global menus and functionality, 
  481. which are always there regardless of the mode, and mode specific menus and 
  482. functionality, which are only there when Alpha is in a specific mode. For 
  483. instance, the menus from File to Config and the Window menu (the one with 
  484. the three windows icon) are global menus.
  485.  
  486. When you open a file Alpha always chooses a mode for it. Alpha does its 
  487. best to choose the mode you want. Therefore it is important to know how 
  488. Alpha chooses the mode. The following is considered:
  489. • The suffix in the file name. For example, 'file.c' is opened in C++ mode 
  490. because of the '.c' suffix, 'file.html' is opened in HTML mode because of 
  491. the '.html' suffix. You can view and edit the suffix mapping using the menu 
  492. item "Config->Preferences->Suffix Mappings…"
  493. In this dialog the suffices for each mode is specified as a list of 
  494. patterns matching the file names. In these patterns * stands for 'any 
  495. characters', e.g. the pattern '*.c' matches any file name ending by '.c'. 
  496. As an example, for Perl mode the default patterns are:
  497. *.pl *.ph *.pm
  498. meaning that any file with a name ending by '.pl', '.ph', or '.pm' will be 
  499. opened in Perl mode.
  500. • If the first non-empty line contains a string '-*-Mode: <mode>-*-' 
  501. or '-*-<mode>-*-' (without quotes) then Alpha switches to the mode <mode>.
  502. For example, if the first non-empty line contains '-*-HTML-*-' Alpha opens 
  503. this file in HTML mode.
  504. • If the first non-empty line reads "#!/dir/subdir/command  ..." then Alpha 
  505. tries to find a mode corresponding to 'command'. This kind of line is used 
  506. in unix files.
  507. • In some cases Alpha can choose the mode depending on which application 
  508. has created the file. One example is that files created by MacPerl are 
  509. opened in Perl mode.
  510.  
  511. You can customize which modes Alpha chooses in the last two cases, see the 
  512. Sections modeCreator and unixMode.
  513.  
  514. You can also manually change mode for a window by selecting one in the mode 
  515. popup menu in the status bar. The mode menu is the rightmost of the three 
  516. menus in the status bar. You can also change mode using the menu item 
  517. "Config->Mode Prefs->Change Mode…"
  518.  
  519. Once Alpha has chosen a mode for a window, Alpha remembers it when you 
  520. switch between the windows, until you manually change the mode for the 
  521. window.
  522.  
  523. Tip: Holding down the shift key while selecting a mode in the mode popup 
  524. menu makes Alpha open the help file for the mode instead of changing mode 
  525. for the window. 
  526. Holding down the option key while selecting a mode in the mode popup 
  527. menu makes Alpha give you a description of the mode. However, most of this 
  528. description is hardly of any use unless you know Tcl programming.
  529.  
  530. Global and mode preferences
  531. Alpha has two types or preferences, global and mode preferences. 
  532. • Global preferences always apply regardless of the mode. These are set in 
  533. the various dialogs "Config->Preferences".
  534. • Mode preferences only apply to windows in that mode, and are set in the 
  535. dialog "Config->Mode Prefs->Preferences…". Some modes may also have other 
  536. means of setting preferences. Note that in some cases there are mode 
  537. preferences which coincide with a global preference. In this case the mode 
  538. preference override the global one.
  539.  
  540. The is also another way of customizing Alpha than setting preferences in 
  541. these dialogs. That is using preferences files where you add your own Tcl 
  542. code. There is both a global preferences file, opened using 
  543. "Config->Preferences->Edit Prefs File" and a mode specific one opened using 
  544. "Config->Mode Prefs->Edit Prefs File".
  545.  
  546. To learn about writing your own code for Alpha, see the section Changing 
  547. Alpha's behavior.
  548.  
  549.         Packages
  550.  
  551. Alpha has a very flexible mechanism for adding extra functionality. Much of 
  552. Alpha's functionality has been bundled into a number of so called packages. 
  553. This has two main advantages. First, the user can choose to activate only 
  554. those packages he or she wants and totally ignore the other ones. Second, 
  555. anybody can write and distribute new packages for Alpha.
  556.  
  557. The packages come in three flavors:
  558. • Modes. As have been discussed in the previous section, a mode gives Alpha 
  559. some functionality useful for editing text for a particular purpose, for 
  560. example writing code in various programming languages.
  561. • Menus. A menu is a package which attaches an extra menu to the menu bar.
  562. • Features. A feature gives you some more functionality without attaching a 
  563. menu to the menu bar. However, some features adds a new submenu to a menu 
  564. or some new menu items to a menu.
  565.  
  566. In practice the only difference between 'menus' and 'features' is that 
  567. 'menus' have their own menus in the menu bar.
  568.  
  569. Alpha comes with a large number of packages. See the file Packages for a 
  570. complete list of them and for links for help for each of them. To find help 
  571. for a specific package you can also use the menu item 
  572. "Config->Packages->Read Help For A Package…"
  573. To learn how to install new packages see the Section Installing New Packages.
  574.  
  575. Menus and features can be activated and deactivated either globally or for 
  576. specific modes. This is done using the menu items 
  577. "Config->Preferences->Menus and Features…" and "Config->Mode Prefs->Menus and 
  578. Features…"
  579.  
  580. Activating a menu or feature makes the functionality provided by the menu
  581. or feature available until it is deactivated. Alpha remembers which ones
  582. are active next time you run Alpha. Once a menu or feature is deactivated
  583. it does not affect Alpha's behavior at all. It is then as if it did not
  584. exist. Note, however, that in some cases you the package is not deactivated
  585. until you restart Alpha.
  586.  
  587. The dialog "Config->Preferences->Menus and Features…" is divided into two 
  588. pages, one for menus and one for features.
  589.  
  590. The page for menus is divided into two sections.
  591. • Usual menus. These are menus designed to be used globally.
  592. • Other possible menus. These are menus designed to be used in a specific 
  593. mode or modes.
  594. Thus, normally it is a good idea to only choose between the menus in the 
  595. section 'Usual menus'. Although it is possible to activate the other menus 
  596. globally, they are usually of no use outside the mode or modes they are 
  597. designed for.
  598.  
  599. The page for features are similarly divided into two sections.
  600. • Usual features. These are features designed to be used globally.
  601. • Other possible features. These are features designed to be used in a 
  602. specific mode or modes.
  603. Also in this case it usually only make sense to choose between the ones in 
  604. the section 'Usual features'.
  605.  
  606.         Tiling windows
  607.  
  608. Alpha provides many different ways to move windows around the screen, most 
  609. of which are accessible via the windows menu, i.e the menu with the window 
  610. icons. The first four items of the "Windows->Arrange" menu move windows 
  611. around a virtual box on the screen, defined by the preferences found in the 
  612. dialog "Config->Preferences->Tiling".
  613. Vertically
  614. Tiles 'Num Wins To Tile' number of windows vertically. Preferences which 
  615. affects the tiling:
  616. 'Tile Top' The position of the upper edge of the top window.
  617. 'Def Width' The width of the windows. (Def Width is set in the Windows 
  618. preferences dialog.)
  619. 'Tile Margin' Controls the gap between the windows.
  620. 'Tile Height' Determines the height of the windows by the formula
  621.          (Tile Height + (Tile Margin -1))
  622. height = ________________________________
  623.                 Num Wins To Tile
  624. Horizontally
  625. Tiles 'Num Wins To Tile' number of windows horizontally. Preferences which 
  626. affects the tiling:
  627. 'Tile Height' The height of the windows.
  628. 'Tile Left' The position of the left edge of the left window.
  629. 'Hor Margin' Controls the gap between the windows.
  630. 'Tile Width' Determines the width of the windows by the formula
  631.          (Tile Width + (Hor Margin -1))
  632. width = ________________________________
  633.                 Num Wins To Tile
  634. Unequal Vert and Unequal Hor
  635. Tile two window by splitting the space between them, with the proportion 
  636. assigned to the first controlled by 'Tile Proportion'.
  637.  
  638.  
  639.         Command-double-clicking
  640.  
  641. Command-double-clicking on a word activates a mode specific function which
  642. uses the word you clicked on as input. In several programming modes, Alpha
  643. tries to find the definition of the word you clicked on. Some examples:
  644.  
  645. When command-double clicking on a word in a C++ file Alpha first checks if
  646. you clicked on an #include statement. Alpha then tries to open the file.
  647. Next Alpha tries to look up the word in the tag file. If the word is not a
  648. tag, or no tags have been specified, Alpha attempts to lookup the word
  649. through the THINK Reference app. If you would like Apple's Toolbox
  650. Assistant to be used instead, edit the proc 'C++::DblClick'.
  651.  
  652. In Tcl mode, if you click on a variable Alpha displays its value, if you
  653. click on a command Alpha tries to look it up first in the Tcl folders, then
  654. in "Alpha Commands", and then finally in "Tcl Commands".
  655.  
  656.         Command-clicking
  657.  
  658. Command-clicking on any text causes Alpha to try find a URL anywhere near 
  659. where you click. If Alpha finds one it sends it to Internet Config which 
  660. passes it to the right helper application. Unfortunately, this feature is 
  661. rather buggy. Whenever there is a colon nearby where you click Alpha 
  662. usually thinks there is a URL, although there is not, and sends it to 
  663. Internet Config. If Internet Config returns an error Alpha then interprets 
  664. your command-click as a command-double-click instead.
  665.  
  666.         Undo + Redo
  667.  
  668. Alpha supports unlimited undo and redo. This means that most changes can be 
  669. undone, and then redone, at will. Bear in mind that once you create new 
  670. modifications, all changes that you have undone but not redone are lost. 
  671. Another point to bear in mind is that saving a buffer to disk flushes the 
  672. undo buffer.
  673.  
  674.         Text Wrapping
  675.  
  676. Alpha can wrap the text as you type in three different ways. How Alpha 
  677. wraps the text can be set for each mode. Presumably you want Alpha to wrap 
  678. plain text files, like this one, but not to wrap programming code.
  679. How the wrapping is done is indicated in the leftmost popup menu in the 
  680. statusbar, where also the way of wrapping can be changed. A change affects 
  681. the current mode, not only the current window. The three ways of wrapping 
  682. are:
  683.  
  684. None    No wrapping.
  685. Wrap    When you type beyond 'Fill Column' positions, Alpha inserts a line 
  686.         break to make you continue typing on the next line. 
  687. Soft    Soft text wrapping is re-formatting the rest of the paragraph 
  688.         on-the-fly as text is inserted and deleted. Soft-wrapping is 
  689.         enabled by selecting "Soft" in the wrap popup menu in the status 
  690.         bar. The text to be wrapped is delimited by the current line and 
  691.         the last line in the current paragraph. Wrapping occurs after 
  692.         insertions that result in the current line becoming longer than 
  693.         'Wrap High' characters long (tabs counted as one character), or 
  694.         deletions where the length of the line (tabs likewise) becomes less 
  695.         than 'Wrap Low' characters long.
  696.         The soft wrapping is not "true" soft wrapping like the one used by 
  697.         word processors. Alpha rather reformat the paragraph and insert line 
  698.         breaks at new positions on-the-fly.
  699.  
  700. The values for 'Fill Column', 'Wrap High', and 'Wrap Low' can be changed 
  701. in the dialog "Config->Preferences->Text".
  702.  
  703.         Indentation
  704.         
  705. Alpha automatically indents the text for you to make it easier to read. How
  706. the text is indented is mode dependent. In programming modes Alpha will
  707. indent blocks of code, like e.g. an if-else statement in
  708. C/C++/Java/JavaScript etc.
  709.  
  710. if (a == 5) {
  711.     b = 5;
  712. } else {
  713.     b = 17;
  714. }
  715.  
  716. How many positions the code is indented is determined by the preference 
  717. 'Indentation Amount', which can be set in the dialog 
  718. "Config->Preferences->Electrics". By default the code is indented 4 
  719. positions for each level of indentation.
  720.  
  721. Whether the code will be indented by spaces or tabs is dependent of the tab
  722. size, which can be set in the dialog "Config->Preferences->Appearance". By
  723. default the tab size is 8. Thus with the default setting clearly your code
  724. can't be indented using tabs alone. 'Odd' indents will require a number of
  725. tabs plus 4 spaces, and 'Even' indents will be ok with just tabs.
  726.  
  727. If you want the code to be indented with spaces only, activate the feature 
  728. "Indent Using Spaces Only" in the dialog "Config->Preferences->Menus and 
  729. Features…".
  730.  
  731.         Electrics - automatic typing by Alpha
  732.         
  733. The term "electric" is used in the sense of "automatic, power assisted 
  734. behavior", which is intended to save time, keystrokes, and brainpower. All 
  735. the "electric" features are features, which makes Alpha do automatic typing 
  736. for you. The exact behavior is mode dependent. The various electric 
  737. features and enabled/disabled either globally in the dialog 
  738. 'Config->Preferences->Menus And Features…' or per mode in the dialog 
  739. 'Config->Mode Prefs->Menus And Features…'.
  740.  
  741. Electric return
  742. Enabling the 'Electric Return' feature tells Alpha to indent the following 
  743. line automatically whenever you press return.
  744.  
  745. Electric braces
  746. Enabling the 'Electric Braces' feature tells Alpha to treat the left or 
  747. right brace '{', '}' keys as special keypresses which enter the '{' or '}' 
  748. character, followed by a return and then indent the following line 
  749. correctly. It is useful for those programming modes in which '{' and '}' 
  750. are used to delineate blocks of code in 'for' loops or 'if-then-else' 
  751. groups etc.
  752. If you only want a '{' or '}' without the electric behavior, type option-{ 
  753. or option-}.
  754.  
  755. Electric semicolon
  756. Enabling the 'Electric Semicolon' feature tells Alpha to treat the 
  757. semicolon keys ';' as special keypresses which enters the ';' character 
  758. followed by a return and then indents the following line correctly. It is 
  759. useful for some programming modes in which ';' normally ends a line. The 
  760. ';' key is context-dependent so you can still enter a for( ; ; ) loop in C 
  761. mode (for instance) without Alpha messing things up.
  762. If you want a ';' without the electric behavior, type option-;.
  763.  
  764. Electric colon
  765. Enabling the 'Electric Colon' feature tells Alpha to indent lines ending by 
  766. a colon differently. This is for those programming modes which uses 
  767. switch-case statements like e.g. C/C++, Java, and JavaScript.
  768.  
  769. Electric completions
  770. Enabling the 'Elec Completions' feature gives you a set of features to save 
  771. you key strokes. When you invoke it Alpha tries to expand what you have just 
  772. typed to give the rest of what you want. Electric completion is invoked by 
  773. typing command-tab or F1. The documentation will always refer to 
  774. command-tab as being the key combination for electric completion. However, 
  775. command-tab conflicts with the application switching feature introduced in 
  776. Mac OS 8.5. Read more about this conflict below.
  777.  
  778. Alpha can complete what you just have typed in several different ways, and 
  779. the behavior vary from mode to mode. In many modes Alpha tries a set of 
  780. different ways to complete and continues until one of them succeed (or all 
  781. fails). Let us start with the simplest kind of completion, but which 
  782. normally is tried last when everything else has failed.
  783.  
  784. Word completion: Type the first few letters of a word and hit command-tab 
  785. (or F1). Alpha will then search the document for a word which begins with 
  786. these letters. If one is found Alpha completes the word you have just typed 
  787. the first letters of. If this is not the word you want, hit command-tab 
  788. again and Alpha continues searching for another one beginning with the same 
  789. letters. Hitting command-tab repeatedly will cycle through all words in the 
  790. document beginning with these letters until no more such word is found. 
  791. Alpha always starts searching backwards from the point where you are until 
  792. is reaches the top of the document, then is continues searching forwards 
  793. from the point where you are until the end of the document.
  794.  
  795. An example: Typing 'com' right here and hitting command-tab will expand 
  796. this to 'command', which is the first word beginning by 'com' found above. 
  797. Hitting command-tab again without moving the insertion point will expand it 
  798. it 'completes', which is the next word beginning by 'com' found above.
  799.  
  800. Command template completion: For for loops, if statements and similar 
  801. constructs used in programming languages Alpha can insert a template. As 
  802. an example let's make an 'if' template for C, C++, Java, and other 
  803. languages using the same construct. Simply type 
  804.  
  805. if
  806.  
  807. (when Alpha is in C, C++, or Java etc. mode!) and hit command-tab. Alpha 
  808. then inserts a template
  809.  
  810. if (|){
  811.     •
  812. } •
  813.  
  814. with the insertion point between the parentheses. The bullets '•', which 
  815. are inserted are called template stops. When you hit tab, Alpha jumps to 
  816. the next template stop and deletes. To use the template first type the 
  817. condition and then hit tab. Alpha the jumps to the first bullet and deletes 
  818. it. Then type the body of the if statement and finally hit tab again to 
  819. jump to the last template stop. Note! The feature 'Electric tab' must be 
  820. enabled for the mode in question to be able to jump between the template 
  821. stops with tab, see below.
  822.  
  823. This section has only been a short introduction to electric completions. 
  824. More detailed help is found in ElecCompletions Help. 
  825.  
  826. Some modes also have their own tutorial how to use completions in the mode. 
  827. The tutorial is opened using 'Config->Mode Prefs->Completions Tutorial'. 
  828. See also the documentation for the mode.
  829.  
  830. Electric tab
  831. Enabling the 'Electric Tab' feature allows Alpha you to use the functions 
  832. 'Indent or Next Stop' and 'Complete or Tab' as any of your 'Special Keys' 
  833. bindings. By default 'tab' is invokes the function 'Indent or Next Stop', 
  834. but there is no key which invokes 'Tab or Complete'.
  835. Indent or Next Stop will first look forward for a template stop '•'. If one 
  836. is found Alpha jumps to it and deletes it. If no • is found Alpha will 
  837. instead indent the current line.
  838. Complete or Tab will make an electric completion.
  839. If you want to insert a normal 'tab', type option-tab.
  840.  
  841. Electric expansions
  842. Enabling the 'Elec Expansions' feature provides you with a special kind of 
  843. word completion. When you find yourself typing a lot of variable and 
  844. function names over and over, and these names are word-combinations where 
  845. the name is formed by either capitalizing each word or separating them with 
  846. an underscore, just type the initial letter of each word and invoke 
  847. electric expansion instead. This is often shorter and more natural than 
  848. typing a few letter and using electric completions to make a word 
  849. completion. Electric expansion is invoked by typing command-space.
  850.  
  851. The string you are going to use expansion on is entered in lowercase. The 
  852. words in the target you are trying to hit have to start with a capital 
  853. (except the first word), or, be separated by an underscore.
  854.  
  855. The hint can be embedded between non-alphabetic characters and certain 
  856. punctuation marks ( '[', '(', '{', ',', ';', ':', ''', '"', ']', ')', '}' 
  857. ). The expanded hint remains so embedded, and the cursor appears one space 
  858. beyond the trailing punctuation.
  859.  
  860. An example: Let's say there is a word 'someLongWord' in the file. Then 
  861. typing 'slw' and hitting command-space will expand 'slw' to 'someLongWord'.
  862.  
  863. Another example: Let's say there is a word 'some_long_word' in the file. Then 
  864. typing 'slw' and hitting command-space will expand 'slw' to 'some_long_word'.
  865.  
  866. This section has only been a short introduction to electric expansions. 
  867. More detailed help is found in ElecCompletions Help. Some modes may also 
  868. their own special expansions features, see the help files for the respective 
  869. modes.
  870.  
  871. Special keys dialog
  872.  
  873. The dialog "Config->Special Keys…" is used to define the keys which
  874. activate the electric completion and expansion functions and which let
  875. you jump between the template stops. You can define keys for the following
  876. functions:
  877.  
  878. Function                Action
  879. Expand                  Electric expansion.
  880. Next stop or indent     Alpha first looks forward for a template stop '•'. 
  881.                         If one is found Alpha jumps to it and deletes it. 
  882.                         If no • is found Alpha will instead indent the 
  883.                         current line. This requires that 'electric tab' is 
  884.                         enabled, otherwise a tab is inserted.
  885. nth Stop                Jumps to the nth template stop.
  886. Complete or Tab         If 'electric tab' is enabled Alpha will make an 
  887.                         electric completion, otherwise a tab is inserted.
  888. Next stop               Jump to the next template stop '•' and delete it.
  889. Clear all stops         Delete all template stops '•' in the window.
  890. Complete                Electric completion.
  891. Real tab                Inserts a tab.
  892. Prev stop               Jump to the closest template stop '•' before the 
  893.                         current position and delete it.
  894.  
  895. There are two predefined sets of key bindings for these functions. The 
  896. alternative set is define to use key bindings like those which are used in 
  897. Emacs. In the dialog 'Config->Special Keys…' you can choose one of these 
  898. two sets of bindings or define your own.
  899.  
  900. Function                Default binding             Alternative binding
  901. Expand                  command-space               command-space
  902. Next stop or indent     tab                         no binding
  903. nth Stop                control-tab                 control-tab
  904. Complete or Tab         no binding                  tab
  905. Next stop               no binding                  control-j
  906. Clear all stops         shift-control-tab           shift-control-tab
  907. Complete                command-tab                 no binding
  908. Real tab                option-tab                  option-tab
  909. Prev stop               shift-tab                   shift-control-j
  910.  
  911. Electric completions and Mac OS 8.5
  912. In Mac OS 8.5 command-tab is used to switch between application. This 
  913. conflicts with Alpha's use of command-tab for electric completions. This 
  914. problem can be solved in three different ways:
  915. • By default 'Electric completion' in Alpha is also bound to F1. Use F1
  916. instead of command-tab. However, the package "Electric menu" uses F1
  917. for someting else, so if you activate the "Electric menu", using F1 for
  918. electric completions is not possible.
  919. • Use the dialog "Config->Special Keys…" to define a new key combination for 
  920. Electric completion.
  921. • Change the key combination for switching applications in Mac OS. This is 
  922. done in the following way:
  923.     • Open the Help Viewer
  924.     • Search on "tab" (or whatever is appropriate in your language)
  925.     • Select "Switching between open programs"
  926.     • Scroll down to the end of "Switching from one program to another"
  927.     • Click "Help me modify the keyboard shortcuts"
  928.  
  929.         Coloring
  930.         
  931. Alpha supports automatic coloring of the text. The way Alpha colors the 
  932. text depends on the current mode. There are basically three different 
  933. things Alpha can color.
  934. Keywords    A set of words with a special meaning, e.g. keywords in 
  935.             programming languages.
  936. Strings     Text delimited by double quotes. Alpha can color single-line 
  937.             strings only.
  938. Comments    Comments in programming code.
  939. For details about the coloring in a specific mode, see the help file for 
  940. the mode. The coloring support in the different modes differ and some 
  941. modes have a more complex coloring support than just the basic things 
  942. mentioned above.
  943.  
  944. Colors for keywords, strings, and comments (for applicable modes) can all 
  945. be changed via the "Config->Mode Prefs->Preferences…" menu item. Some 
  946. modes may offer more extensive customization.
  947.  
  948. By default there are seven different colors to choose between, blue, cyan, 
  949. green, magenta, red, white, and yellow. If you wish you can redefine these 
  950. via the menu "Config->Redefine Colors". For instance, you can redefine 'red', 
  951. and any text that is currently red will then be the new color you specify. 
  952. In addition, there are eight other colors 'Color_9' through 'Color_15' 
  953. which you can use to define your own colors. Note that by default these 
  954. colors do not show up in the mode preferences dialog because until you have 
  955. given them a value they are undefined.
  956.  
  957. Coloring can be turned off completely by unchecking 'Coloring' in the 
  958. dialog "Config->Preferences->Appearance".
  959.  
  960. Additionally, Alpha allows the text color and window background to be 
  961. changed. These are changed by redefining 'Foreground' and 'Background' in 
  962. the "Config->Redefine Colors" menu.
  963.  
  964. Advanced coloring customization 
  965.  
  966. If you don't find the customization in the mode preferences dialog 
  967. sufficient, you can customize the coloring by adding some Tcl code to the 
  968. mode preferences file. This file is opened via the "Config->Mode 
  969. Prefs->Edit Prefs File" menu item. Coloring is defined using the command 
  970. regModeKeywords. For a complete descriptions how to use regModeKeywords, 
  971. see the file Alpha Commands. Here follows a few examples.
  972.  
  973. As an example the line:
  974.  
  975.     regModeKeywords -a -k blue Fort {blah bladdity}
  976.     
  977. will add the keywords 'blah' and 'bladdity' colored blue in Fortran mode.
  978.  
  979.         Search and Replace
  980.         
  981. Alpha has a full repertoire of searching commands. The 'Find' menu item in 
  982. the Search menu brings up a dialog allowing the search and replacement text 
  983. to be specified. Alpha can search either the current open window or a set 
  984. of files. 
  985. The dialog also allows the following options:
  986. Forward         To search the text forwards or backwards. This does not apply when 
  987.                 multiple files are searched.
  988. Ignore Case     Whether the search should match case or not.
  989. Word Match      Whether the search should match only complete words or not.
  990. Batch           When making a batch search, a list of all matches in the 
  991.                 fileset or current window are displayed in a new 
  992.                 browser window. A particular match can be displayed by 
  993.                 moving the cursor to a line in the file of matches and  
  994.                 hitting "return".
  995. Grep            The search and replace text strings are interpreted as 
  996.                 regular expression. The word 'grep' comes from the unix 
  997.                 command with the same name.
  998. Mult Files      To search through all files in a given file set. Checking 
  999.                 the 'Mult Files' box brings up a new popup menu. In this 
  1000.                 menu you can choose which fileset to search. You can either 
  1001.                 select an existing fileset in the menu or create a new one 
  1002.                 by selecting "New Fileset…". Read more about fileset in the 
  1003.                 file Filesets Help.
  1004.                 In addition to the current filesets, the menu has an item 
  1005.                 called 'Directory Scan'. This allows you to specify a 
  1006.                 folder that will be searched. This folder is also saved at 
  1007.                 the end of the menu for future searches.
  1008.  
  1009. And finally, Alpha allows a library of useful search and replace texts to
  1010. be defined. This library is used and edited in the popup menu 'Patterns'.
  1011. Selecting a pattern from the menu inserts the search and replace strings in
  1012. the dialog. In addition
  1013. Remember Pattern creates a new item in the menu from the current search and 
  1014. replace strings.
  1015. Delete Pattern lets you delete a pattern from the menu.
  1016.  
  1017. Incremental Searches
  1018. Emacs users will be happy that both forward and backward incremental 
  1019. searches are implemented. Incremental searches bypass the normal search 
  1020. dialog and search for the current text after each keystroke. The result is 
  1021. often much faster and less intrusive. The menu items 'Quick Find' and 
  1022. 'Reverse Quick Find' in the Search menu are the forward and backward 
  1023. incremental searches respectively. Start the search either from the menu or 
  1024. by typing ctrl-s or ctrl-r, then type the word you are searching for. After 
  1025. each letter you've typed Alpha jumps to the nearest point in the text 
  1026. matching what you have typed so far. The search string is also displayed in 
  1027. the status bar.
  1028.  
  1029. Typing ctrl-s or ctrl-r again while an incremental search is in progress 
  1030. causes the search to proceed to the next instance of the current text. 
  1031. Incremental search mode is exited when any other command (executed through 
  1032. the menus or through bindings that include at least one of the control key 
  1033. and the option key) is executed, or when the escape or delete key is used. 
  1034. Typing control-w while incremental search is active causes all the 
  1035. characters to the end of the next word boundary to be added to the search.
  1036.  
  1037.         Browser Window
  1038.  
  1039. Browser windows are used to list the result of batch searches, as well as 
  1040. other similar lists. Each line in the browser window refer to a certain 
  1041. line in a file, in the case of batch searches the lines where what you 
  1042. searched for have been found. Navigate the windows using the up and down 
  1043. arrows, and jump to the match - i.e. the line in the file referred to by 
  1044. the line in the browser window - by hitting 'return'.
  1045.  
  1046. The browser windows are actually in a special mode, the browser mode. The 
  1047. complete set of keybindings in this mode is:
  1048.  
  1049. uparrow             move up one line in the window and select the line
  1050. ctrl-p                                      -"-
  1051. delete                                      -"-
  1052. downarrow           move down one line in the window and select the line
  1053. ctrl-n                                      -"-
  1054. space                                       -"-
  1055. return              go to match
  1056. enter                   -"-
  1057. ctrl-C ctrl-C           -"-
  1058.  
  1059. In the Search menu there is also a very useful command 'Next Match'. 
  1060. Regardless which window is frontmost, it brings the browser window to the 
  1061. front, navigate down one line, and goes to the match of that line. Thus, 
  1062. this gives you a quick way to jump to all matches without having to 
  1063. manually bring the browser window to the front.
  1064.  
  1065.         Regular Expressions
  1066.  
  1067. Regular expressions are used to find the part of a string which matches a 
  1068. certain pattern.
  1069.  
  1070. A regular expression is zero or more branches, separated by `|'. It matches
  1071. anything that matches one of the branches.
  1072.  
  1073. A branch is zero or more pieces, concatenated. It matches a match for the
  1074. first, followed by a match for the second, etc.
  1075.  
  1076. A piece is an atom possibly followed by `*', `+', or `?'. An atom followed
  1077. by `*' matches a sequence of 0 or more matches of the atom. An atom
  1078. followed by `+' matches a sequence of 1 or more matches of the atom. An
  1079. atom followed by `?' matches a match of the atom, or the null string.
  1080.  
  1081. An atom is a regular expression in parentheses (matching a match for the
  1082. regular expression), a range (see below), `.' (matching any single
  1083. character), `^' (matching the null string at the beginning of the input
  1084. string), `$' (matching the null string at the end of the input string), a
  1085. `\' followed by a single character (matching that character), or a single
  1086. character with no other significance (matching that character).
  1087.  
  1088. A range is a sequence of characters enclosed in `[]'. It normally matches
  1089. any single character from the sequence. If the sequence begins with `^', it
  1090. matches any single character not from the rest of the sequence. If two
  1091. characters in the sequence are separated by `-', this is shorthand for the
  1092. full list of ASCII characters between them (e.g. `[0-9]' matches any
  1093. decimal digit). To include a literal `]' in the sequence, make it the first
  1094. character (following a possible `^'). To include a literal `-', make it the
  1095. first or last character.
  1096.  
  1097. If a regular expression could match two different parts of the input
  1098. string, it will match the one which begins earliest. If both begin in the
  1099. same place but match different lengths, or match the same length in
  1100. different ways, life gets messier, as follows.
  1101.  
  1102. In general, the possibilities in a list of branches are considered in
  1103. left-to-right order, the possibilities for `*', `+', and `?' are considered
  1104. longest-first, nested constructs are considered from the outermost in, and
  1105. concatenated constructs are considered leftmost-first. The match that will
  1106. be chosen is the one that uses the earliest possibility in the first choice
  1107. that has to be made. If there is more than one choice, the next will be
  1108. made in the same manner (earliest possibility) subject to the decision on
  1109. the first choice. And so forth.
  1110.  
  1111. For example, `(ab|a)b*c' could match `abc' in one of two ways. The first
  1112. choice is between `ab' and `a'; since `ab' is earlier, and does lead to a
  1113. successful overall match, it is chosen. Since the `b' is already spoken
  1114. for, the `b*' must match its last possibility-the empty string-since it
  1115. must respect the earlier choice.
  1116.  
  1117. In the particular case where no `|'s are present and there is only one `*',
  1118. `+', or `?', the net effect is that the longest possible match will be
  1119. chosen. So `ab*', presented with `xabbbby', will match `abbbb'. Note that
  1120. if `ab*' is tried against `xabyabbbz', it will match `ab' just after `x',
  1121. due to the begins-earliest rule. (In effect, the decision on where to start
  1122. the match is the first choice to be made, hence subsequent choices must
  1123. respect it even if this leads them to less-preferred alternatives.)
  1124.  
  1125. To summarize, regular expressions are built up of the following pieces:
  1126.  
  1127.  c        literal char.
  1128.  ^        beginning of line.
  1129.  $        end of line.
  1130.  .        any character except carriage return.
  1131.  [...]    character class, can use ranges such as '0-9'.
  1132.           inside classes. Matches one character of the 
  1133.           enclosed choices. Ex: '[ac0-2]' matches 'a', 
  1134.           'c', '0', '1', or '2'.
  1135.  [^...]   negated character class, matches anything but
  1136.           the enclosed characters. ']' can be included
  1137.           by putting it immediately after the '^'.
  1138.  \t       tab.
  1139.  \r       carriage return or line break.
  1140.  *        zero or more occurrences of the previous
  1141.           pattern. Ex: 'ab*' matches 'a', 'ab', 'abb',
  1142.           'abbb' etc.
  1143.  +        one or more occurrences of the previous 
  1144.           pattern. 
  1145.  ?        zero or one occurrences of the previous 
  1146.           pattern. Ex: 'ab?' matches 'a' or 'ab'.
  1147.  a|b      matches either a or b. If enclosed in
  1148.           parenthesis, the extent of the alternated
  1149.           expressions is limited. Ex: (pete|bob) 
  1150.           matches either 'pete' or 'bob'.
  1151.  (...)    The interior elements are grouped together. 
  1152.  
  1153. Regular expressions constructed from the above elements can be 
  1154. concatenated to create larger expressions. 
  1155.  
  1156. The parenthesis also define substrings of the total matched string that 
  1157. can be used either later during substitution. The substring delimited by 
  1158. the pair of parenthesis that includes the nth left paren is denoted \n, 
  1159. where n is 1, 2, .... 9.  '\0' and '&' both refer to the matched text.
  1160.  
  1161. [examples to be added]
  1162.  
  1163.         File Patterns
  1164.         
  1165. Some functions require that you give a file pattern which specifies a set 
  1166. of file names, e.g. if you want to change the suffix mappings you must give 
  1167. a pattern specifying which files should be opened in a certain mode, and as 
  1168. another example if you want to create a fileset you must give a pattern 
  1169. specifying which files should belong in the fileset.
  1170.  
  1171. A file pattern is given as a string including special characters, which 
  1172. allow automatic substitution of characters in file names.
  1173.  
  1174.     ?           Matches any single character.
  1175.  
  1176.     *           Matches any sequence of zero or more characters.
  1177.  
  1178.     [chars]     Matches any single character in chars. If chars contains a 
  1179.                 sequence of the form a-b then any character between a and b 
  1180.                 (inclusive) will match. To match '-' give it as the first 
  1181.                 character between the brackets.
  1182.  
  1183.     \x          Matches the character x. This is useful if you want to 
  1184.                 match any of the special characters, e.g to matching '*' is 
  1185.                 done by the pattern '\*'.
  1186.     
  1187.     {a,b,...}   Matches any of the strings a, b, etc.
  1188.  
  1189. Some examples of how to use file patterns:
  1190. • To match any file ending by '.c' use the pattern '*.c'. This will match 
  1191. files with names like 'blah.c' 'bladdity.c' 'gghjcdhj.c'.
  1192. • To match any file ending by '.c' or '.h' use the pattern '*.{c,h}'. This 
  1193. will match files with names like 'blah.c' 'blah.h' 'bladdity.c' 
  1194. 'bladdity.h'.
  1195. • Lets say you have files with names 'chapter1.tex', 'chapter2.tex' through 
  1196. 'chapter50.tex'. To match the first 9 chapters you could use the pattern 
  1197. 'chapter?.tex' This will match the files 'chapter1.tex' through 
  1198. 'chapter9.tex'. Another pattern which would match the same files is 
  1199. 'chapter[1-9].tex'.
  1200. • To match the files 'chapter1.tex' through 'chapter9.tex' and 
  1201. simultaneously files 'chapter1.log' through 'chapter9.log' you can use the 
  1202. pattern 'chapter[1-9].{tex,log}'
  1203.         
  1204.         Marks
  1205.  
  1206. Alpha allows the user to use "marks" to remember positions in files. Marks
  1207. "float". That is, if a mark is initially at position 312 and then five
  1208. characters are inserted at location 297, the mark's new value will be 317.
  1209. Alpha uses three different types of marks.
  1210.  
  1211. The first is generically referred to as "the mark". The mark is set to the
  1212. current insertion point by the command 'Set Mark' (control-space). (This
  1213. requires that the Emacs feature is active.) The position in the file
  1214. indicated by the blinking cursor is referred to as the current insertion
  1215. point. Many commands (such as "cut" and "copy") can operate either on the
  1216. currently selected (hilighted) text, or the text between the current
  1217. insertion point and "the mark". For example, if you move the cursor to the
  1218. beginning of the word "allybaba", hit control-space (the status bar should
  1219. say "Mark set"), move to the end of the word and hit option-W (the status
  1220. bar should say "Region copied"), the effect is the same as if you had used
  1221. the mouse to select the text and then selected the "Copy" command from the
  1222. "Edit" menu.
  1223.  
  1224. The second type of mark are the permanent marks. Permanent marks are set,
  1225. removed, and moved-to through the three corresponding menu items in the
  1226. "Search->Named Marks" menu. Permanent marks differ from the generic mark in
  1227. that they have names, there can be any number of them, and they are saved
  1228. in the resource fork if the file is subsequently saved.
  1229.  
  1230. Permanent marks can be accessed via the "Search->Named Marks" menu items,
  1231. by a popup menu called by mousing down on the M icon above a vertical
  1232. scrollbar, or by command-mousing on a window's titlebar.
  1233.  
  1234.         International Users
  1235.         
  1236. There is a basic problem international users will notice, which have to do 
  1237. with the fact that the keyboard layouts are different in different countries. 
  1238. Therefore some keybindings in Alpha may not work with all keyboards. For 
  1239. example, on a Swiss keyboard, '/' is shift-7 (which means you have to press 
  1240. shift to get '/'. This means there is no difference between cmd-/ and 
  1241. shift-cmd-/ on such a keyboard. In Alpha these are bound separately to 
  1242. 'zoom' and 'singlePage'.
  1243.  
  1244. If you're using a western keyboard Alpha can solve some of these problem
  1245. for you.
  1246.  
  1247. First: Activate the "International Menus" feature. It replaces some
  1248. keybindings in the menus and solves problems like the one just described.
  1249. However, only key bindings in the global menus "File" to "Windows" are
  1250. modified. Any other menu may still have problems.
  1251.  
  1252. Second: Tell Alpha which keyboard layout you're using in the preferences 
  1253. dialog "Config->Preferences->International". (In a future version, Alpha 
  1254. should be able to get this information from the OS directly.) This will 
  1255. make sure that some bindings not defined in the menus work, e.g. that the 
  1256. electric braces work. However, problematic bindings defined in the various 
  1257. packages are usually not cured by this.
  1258.  
  1259. Which menu items are affected?
  1260.  
  1261. The menu items that the International Menus package change are (depending 
  1262. on which keyboard layout you use, some of these may remain unchanged):
  1263.  
  1264. Edit menu: Twiddle, Twiddle Words, Shift Left/Right, Shift Left/Right Space
  1265. Search menu: Return to Bookmark, Goto Line, Mark Hilite
  1266. Windows menu: Zoom, Default Size, Choose A Window
  1267.  
  1268. Teaching Alpha new keyboard layouts 
  1269. If you're not using a western keyboard or if you do encounter any problems,
  1270. reading the following section will help to clarify things and should help 
  1271. you to fix the problem. This section requires that you first read the 
  1272. section Changing Alpha's behavior. If you need help defining 
  1273. a new keyboard layout, subscribe to the ALPHA-D mailing list and ask for help.
  1274.  
  1275. To solve the problem with bindings in the menus you can use the 
  1276. menu::replaceWith command. To solve the problem with the Swiss keyboard 
  1277. described above you would add the following to your preferences file:
  1278.    
  1279.     menu::replaceWith winMenu [list "//<Szoom" "//<S<I<OsinglePage"] \
  1280.         items "<S//zoom" "<S<O<U/=singlePage"
  1281.  
  1282. To define your keyboard layout, add a line like this to your preferences 
  1283. file:
  1284.  
  1285.     set "keyboards(U.S.)" {
  1286.      {§1234567890-=[];'\`,./}
  1287.      {±!@#$%^&*()_+{}:"|~<>?}
  1288.      <U/[
  1289.      <U/]
  1290.     }
  1291.  
  1292. The first two lines tell Alpha how to map using the 'shift' key. Shift maps 
  1293. each item in the upper string into the corresponding item in the lower 
  1294. string.
  1295.  
  1296. The third and forth lines defines the keybindings for the left and right 
  1297. braces, in this example to shift-[ and shift-].
  1298.  
  1299. See the file alphaDefinitions.tcl for examples of keyboard layout 
  1300. definitions.
  1301.  
  1302. If you define an array entry keyboards(my-country), then you can just 
  1303. select that in the international prefs dialog, and Alpha will set the flags 
  1304. correctly. You can then send that keyboard array entry to the ALPHA-D 
  1305. mailing list for inclusion in a future version of Alpha.
  1306.  
  1307. If a package wishes to be told when the keyboard changes, it can do 
  1308. that by registering with the 'removekeyboard' or 'keyboard' hooks like
  1309. this:
  1310.  
  1311.     # tell me when we switch to a "Swiss German" keyboard
  1312.     hook::register keyboard keys::swiss "Swiss German"
  1313.     # tell me when we disable a keyboard
  1314.     hook::register removekeyboard my_disable_proc
  1315.     # tell me when we enable a keyboard
  1316.     hook::register keyboard my_enable_proc
  1317.     
  1318. In this way a clever package could remove the need for restarting 
  1319. Alpha by unbinding and then rebinding all necessary items.
  1320.  
  1321.         File Comparison
  1322.  
  1323. With Alpha you can compare files and display the differences in them. Among 
  1324. other things, this allows you to easily pinpoint what has changed between 
  1325. two different versions of the same file. Using the menu "Utils->Compare" you 
  1326. can either compare the two topmost windows, or two arbitrary files or two 
  1327. entire folders. In the case of two folders each pair of files with 
  1328. identical names in the two folders are compared. It is also indicated which 
  1329. files are only found in one of the folders.
  1330.  
  1331. The comparison is done using a port of the unix GNU diff program.
  1332.  
  1333. Alpha opens the two files in windows at the top of the screen with the diff 
  1334. file at the bottom. You can navigate between individual differences in the 
  1335. diff file by using the Up and Down arrows. The section of the files which 
  1336. differ are then selected in the two files.
  1337.  
  1338. This section has only been a short introduction to the use of file 
  1339. comparison with Alpha. Read more in the file Diff Help
  1340.  
  1341. Bugs: File comparison only works if the files have Mac line terminations.
  1342.  
  1343.         Helper Applications
  1344.  
  1345. Alpha uses many helper application, e.g. a web browser and an ftp client.
  1346. You can choose which helpers to use by the menu item
  1347. "Config->Preferences->Helper Applications". Select which helper app you want
  1348. to change.
  1349.  
  1350. Now, in some cases a dialog is opened with a popup menu with some popular 
  1351. apps of the appropriate type. Either choose one from the popup menu, or 
  1352. select 'Locate manually' and click OK to locate the app on your disk.
  1353.  
  1354. In some cases a file dialog is directly opened to let you locate the 
  1355. helper app. 
  1356.  
  1357.         Backups
  1358.  
  1359. Alpha can automatically make a backup copy for you of the old version of a 
  1360. file whenever you save changes. This is done if you check 'Backup' in the 
  1361. preferences dialog "Config->Preferences->Backups". By default the backup file 
  1362. is saved in the same folder, and its name is formed by suffixing a tilde to 
  1363. the name of the saved file. The backup behavior can be modified by changing 
  1364. the following preferences in the dialog "Config->Preferences->Backups":
  1365.  
  1366. Backup              Check this if you want Alpha to make backups.
  1367. Backup Folder       The folder where to save the backups. If none specified 
  1368.                     the backups are saved in the same folder as the 
  1369.                     original.
  1370. Backup Extension    The extension to add to name of the backup file. Don't 
  1371.                     pick a long extension! The total file name mustn't be 
  1372.                     more than 31 characters.
  1373. Backup Age Requirement In Hours     A new backup file is only created if the 
  1374.                     old backup file is older than this.
  1375.  
  1376. If you have chosen a backup folder and want to go back to the default 
  1377. behavior of saving the backup in the document's folder this is how to do 
  1378. it:
  1379. Delete or rename the backup folder. Alpha will then ask you if you want to 
  1380. create the backup folder. If you answer 'No' Alpha will revert to the 
  1381. default behavior.
  1382.  
  1383. Auto saving
  1384. Alpha can automatically save the documents for you after a certain number 
  1385. of changes. This is done if you check 'Auto Save' in the preferences dialog 
  1386. "Config->Preferences->Backups". Alpha then saves the documents every 'Changes 
  1387. Lim' changes. 'Changes Lim' can be set in the same preferences dialog. Note 
  1388. that Untitled windows are not autosaved.
  1389.  
  1390.         Spell Checking
  1391.  
  1392. Alpha has the capability to interact with the spell-checker 'Excalibur', 
  1393. written by Robert Gottshall and Rick Zaccone. The menu item 'Spellcheck 
  1394. Window' is always available in the "Text" menu. Selecting this item will 
  1395. start up Excalibur and open the current window in Excalibur. 
  1396. For version 1.4 and earlier, if Alpha has to launch Excalibur you will need 
  1397. to dismiss Excalibur's opening dialog by hitting the Cancel button. 
  1398. Subsequent selections of the menu item will switch right into Excalibur 
  1399. with the correct file displayed. 
  1400. When switching back from Excalibur to Alpha, Alpha reads the corrected 
  1401. version of the file into the current window.
  1402.  
  1403. There is also a menu item 'Spellcheck Selection'. This copies the current 
  1404. selection to the clipboard and switches to Excalibur. You can then use 
  1405. 'Open Clipboard' in Excalibur's File menu to spellcheck the selection. 
  1406. When you switch back to Alpha you have to paste the corrected text 
  1407. yourself.
  1408.  
  1409. Excalibur can be obtained from http://www.eg.bucknell.edu/~excalibr/excalibur.html
  1410.  
  1411.         Tags
  1412.  
  1413. Alpha supports the use of tags to find declarations of functions; by
  1414. default this is set up only for 'C'. When searching for a tag, Alpha looks
  1415. for the tag file specified by the 'Tag File' preference, which can be set
  1416. in the dialog "Config->Preferences->Tags". Alpha's tag generating routines
  1417. use the regular expression in the preference 'Func Expr' to look for
  1418. function declarations. In other words, we don't parse the text. If you
  1419. declare your functions differently, you can change 'Func Expr' to suit your
  1420. own style. Alpha currently uses the following regular expression to find C
  1421. function declarations:
  1422.  
  1423.               ^[^ \t\(#\r/@].*\(.*\)$
  1424.  
  1425. Although complicated, this expression makes sense if you slowly wade 
  1426. through it. The string that we are looking for must take up an entire 
  1427. line. It must begin with a character other than '\t', '#', '\r', '/', ' ', 
  1428. '(', or '@'. There must be a set of parenthesis.   
  1429.  
  1430. Note that not only can you customize this to your style of 'C'
  1431. declarations, you could also use it to generate tags for other languages.
  1432. The only thing you need to bear in mind is that the tag routines use the
  1433. complete word previous to the first '(' in the selected line as the
  1434. function's name. If there is no '(' in the selected line, the last word in
  1435. the line is used. Therefore, Pascal procedures with or without parameters
  1436. can be identified.
  1437.  
  1438. Caveat: Apple's list manager can't handle more than 32k of text in the 
  1439. entire list, so there is a practical limit of 2000 or so tags in your 
  1440. project.
  1441.  
  1442.         Calculator
  1443.  
  1444. Alpha has its own calculator. This is just a quick-and-dirty RPN stack
  1445. calculator, which works on both signed and unsigned decimals, hex integers,
  1446. and floating point.
  1447.  
  1448. Operations:                                                          
  1449.     +,-,*,/,|,&,%   Top of stack is 'y', next is 'x'. Does x OP y.   
  1450.     ~               bitwise NOT                                      
  1451.     ^               x eor y                                          
  1452.     <               x << y                                           
  1453.     >               x >> y                                           
  1454.     c               change y's sign                                  
  1455.     q               duplicate y                                          
  1456.     i               swap x and y                                     
  1457.     m               switch signed/unsigned/hex modes                         
  1458.     x               show current mode
  1459.     h or ?          help
  1460.     <delete>        pop stack                                        
  1461.     <space>         enter number    
  1462.     opt-P           pi (3.14159265358979323)
  1463.     shift-opt-E     e  (2.718281828459045)
  1464.  
  1465. Invoke from the Utils menu, holding down the shift key.
  1466.  
  1467.         Alpha's Menus
  1468.  
  1469. This section is an explanation of Alpha's main menus, from "File" to
  1470. "Windows" (menu with the window icons). The menu items listed here are the
  1471. ones available when no features are enabled in the dialog
  1472. "Config->Preferences->Menus and Features…". Some of these features add new
  1473. menu items or new submenus to Alpha's main menus.
  1474.  
  1475. Alpha uses Ramon Felciano's Mercury MDEF to display menus. In addition to
  1476. allowing other modifiers to be shown in the menu, this MDEF also allows
  1477. alternates, items that change depending on the state of the modifier keys.
  1478. Alternate items are tagged below by the modifier that must be pressed to
  1479. display it.
  1480.  
  1481. File
  1482.     New                     New file.
  1483.     Open…                   Open file.
  1484.     Close                   Close file.
  1485.     Close All (option)      Close all files.
  1486.     Close Float (shift)     Close a palette.
  1487.  
  1488.     Save                    Save file.
  1489.     Save All (option)       Save all files.
  1490.     Save Unmodified (control) Save file without changing the modification 
  1491.                             date.
  1492.     SaveAs…                 Prompt for name to same file under.
  1493.     Save A Copy As… (option) Save a copy of the open window.
  1494.     Rename To… (shift)      Rename file.
  1495.     
  1496.     Revert                  Revert to last saved version, throw away undo history. 
  1497.     Revert To Backup (option) Revert to last backup copy, if any.
  1498.         
  1499.     File Utils
  1500.         File Remove…        Remove a file.
  1501.         File Info…          Display/edit info about a file.
  1502.         Text to Alpha       Set creator a text files to Alpha.
  1503.         Show in Finder      Select the front window in the Finder.
  1504.  
  1505.     Page Setup…             Set print options.
  1506.     Print…                  Print window.
  1507.     Print All (option)      Print all windows.
  1508.  
  1509.     Quit                    Quit Alpha.
  1510.  
  1511. Edit
  1512.     Undo                    Undo. 
  1513.     Redo                    Redo. 
  1514.  
  1515.     Cut                     Cut selection to scrap.
  1516.     Copy                    Copy selection to scrap.
  1517.     Paste                   Paste from scrap.
  1518.     Select All              Select entire file.
  1519.     Select Paragraph (option)   Select current paragraph.
  1520.     Clear                   Delete selection.
  1521.  
  1522.     Twiddle                 Exchange characters bracketing the selection point.
  1523.     Twiddle Words (option)  Exchange words bracketing the selection point.
  1524.  
  1525.     Shift Left              Shift selection left one tab.
  1526.     Shift Left Space (option)   Shift selection left one space.
  1527.     Shift Right             Shift selection right one tab.
  1528.     Shift Right Space (option)  Shift selection right one space.
  1529.     Balance                 Select text out to the next set of matching braces.
  1530.  
  1531. Text
  1532.     Fill Paragraph          "Fill" paragraph that contains the insertion point.
  1533.     Wrap Paragraph (option) Break lines longer than 'fillColumn' in paragraph 
  1534.                             containing the insertion point.
  1535.     Sentence Paragraph (option-shift) - Forces each sentence to start on new 
  1536.                             line. 
  1537.     Fill Region             "Fill" selection subject to 'leftFillColumn' and 
  1538.                             'fillColumn'.
  1539.     Wrap Region (option)    Break lines longer than 'fillColumn' in selection.
  1540.     Sentence Region (option-shift) - Forces each sentence to start on new 
  1541.                             line. 
  1542.  
  1543.     Line To Paragraph       Convert a line to a paragraph.
  1544.     Paragraph to Line (option) Convert a paragraph to single line.
  1545.     
  1546.     Sort Lines              Sort selected lines.
  1547.     Reverse Sort (option)   Sort selected lines backwards.
  1548.     Spellcheck Window       See here.
  1549.     Spellcheck Selection (control)
  1550.  
  1551.     Zap Invisibles          Delete all chars in file with ASCII code < 32, except 
  1552.                             for LF, TAB and CR.
  1553.     Tabs To Spaces          Convert tabs to space runs.
  1554.     Spaces To Tabs (option) Convert space runs to tabs.
  1555.  
  1556.     Indent Line             Indent the current line.
  1557.     Indent Selection (option) Indent the selection.
  1558.     
  1559.     Upcase Region           Upcase all chars in region.
  1560.     Downcase Region (option) Downcase all chars in region.
  1561.     
  1562.     Strings
  1563.         Insert Prefix           Prepend string 'prefixString' to every line in 
  1564.                                 selection.
  1565.         Remove Prefix (option)  Remove prefix string from lines in selection. 
  1566.         Insert Suffix           Append string 'suffixString' to every line in 
  1567.                                 selection.
  1568.         Remove Suffix (option)  Remove suffix string from lines in selection. 
  1569.         Set Prefix              Change prefix string.
  1570.         Set Suffix              Change suffix string.
  1571.     Comment Line            Comment out line, considering mode.
  1572.     Uncomment Line (option) Un-comment line, considering mode.
  1573.     Comment Box             Create a comment box around selected text.
  1574.     Uncomment Box (option)  Remove such a comment box.
  1575.     Comment Paragraph       Comment out a paragraph.
  1576.     Uncomment Paragraph     Uncomment a paragraph.
  1577.  
  1578. Search
  1579.     Find…                   Present a search dialog.
  1580.     Search Start (option)   Return selection point to where the last search 
  1581.                             started. 
  1582.     Find Again              Search forward again with same settings.
  1583.     Find Again Backward (option)    Search backward again with same settings.
  1584.     Find in Next File       Restart multiple-file search in next file after 
  1585.                             stopping at a match.
  1586.     Enter Search String     Use the current selection as the search text.
  1587.     Enter Replace String (option)   Use the current selection as replace text.
  1588.  
  1589.     Quick Find              Incremental search forward (grep, match words off, 
  1590.                             ignore case on). Type chars to define string, 
  1591.                             control-w adds the current word to the search
  1592.                             string, control-s/r search for the same string again.
  1593.     Quick Find Regexp (option)  Same as Quick Find but lets you use a regular
  1594.                             expression.
  1595.     Reverse Quick Find      Same thing in reverse.
  1596.     
  1597.     Replace                 Replace the selection.
  1598.     Replace and Find Again  Replace the selection and search again forward.
  1599.     Replace All             Replace all of occurances of the search string 
  1600.                             in the rest of the file.
  1601.     Replace in Fileset (control)    Global replace in fileset.
  1602.     
  1603.     Place Bookmark          Set a book mark at the current position, pushing it 
  1604.                             onto a "stack".
  1605.     Return to Bookmark      Pop last bookmark from stack and go to it.
  1606.     Goto Line               Goto specific line number.
  1607.     
  1608.     Matching Lines          Find all lines that match a regular expression and 
  1609.                             summarize in new window. 
  1610.     Goto Match              Jump to the original text specified by the current 
  1611.                             line in a "Batch Find" or "Matching Lines" window.
  1612.     Next Match              Jump to the original text specified by the next 
  1613.                             line in a "Batch Find" or "Matching Lines" window.
  1614.     Goto Func               The same as selection an item in the Funcs menu (the 
  1615.                             one with two curly braces at the right top of the window)
  1616.     Goto File Mark          The same as selection an item in the Marks menu (the 
  1617.                             one with the M icon at the right top of the window)
  1618.     Mark Hilite             Select text last manipulated, such as from a paste.
  1619.     Named Marks->           Manipulating named marks.
  1620.     Unnamed Marks
  1621.         Set…
  1622.         Exchange Point And Mark
  1623.  
  1624. Utils
  1625.     Compare
  1626.         Windows             Compare top two windows, sending output to a third. 
  1627.                             Selecting a line in the third window and hitting 
  1628.                             return (or enter) moves that line to the top of 
  1629.                             the window.
  1630.         Files               Same as above, but prompts for files.
  1631.         Directories         As above, but works for entire folders. 
  1632.     
  1633.     Win Utils
  1634.         Insert Path Name…   Prompt for a file and insert complete pathname in 
  1635.                             window.
  1636.         Insert File…        Insert the text of another file.
  1637.     
  1638.     Ascii Etc
  1639.         Quote Char          Wait for key press and insert key.
  1640.         Key Code            Wait for key press and insert keycode and modifier 
  1641.                             string suitable for key binding.
  1642.         Key Ascii           Same as above, but use ascii form.
  1643.         Get Ascii           Display ascii code for char to right of insertion.
  1644.         Insert Ascii        Prompt for ascii code and insert character.
  1645.         
  1646.     Shell                   Start up command-line shell that interprets Tcl 
  1647.                             commands. The shell has a few csh-type features, 
  1648.                             such as 'ls', 'rm', etc. commands, as well as file 
  1649.                             completion with the TAB key. 
  1650.     Toolserver Shell (control) See here.
  1651.     Calculator (shift)      See here.
  1652.     
  1653.     Word Count              Count lines, words, chars in window.
  1654.     Send URL                Send selection as URL to proper internet application.
  1655.     Cmd-Double Click        See here.
  1656.                             
  1657. Config
  1658.     Preferences             Set global preferences.
  1659.         Menus and Features… Change global menus and features.
  1660.         Suffix Mappings…    Displays and allows editing of suffixes (really
  1661.                             filename patterns) for all existing modes. 
  1662.         Edit Prefs File     Put your own arbitrary startup code here. 
  1663.                             Loaded after all standard Tcl code. 
  1664.         Interface Preferences etc. The rest of this menu is used to set 
  1665.                             preferences.
  1666.                             
  1667.     Packages
  1668.         Miscellaneous Packages…     Set preferences for packages.
  1669.         Describe A Package…         Show a description of a package.
  1670.         Read Help For A Package…    Opens the documentation for a package.
  1671.         Uninstall Some Packages…    Uninstall one or more packages.
  1672.         Internet Updates->          To download packages from Internet.
  1673.         Rebuild Package Indices     The Alpha's index of all installed 
  1674.                                     packages.
  1675.                             
  1676.     Mode Prefs              Set preferences for current mode.
  1677.         Menus and Features… Change current mode's menus and features.
  1678.         Preferences…        Change options for current mode.
  1679.         Edit Prefs File     Edit mode-specific preferences.  Loaded 
  1680.                             after mode entered for the first time.
  1681.         Load Prefs File     Load current mode's preferences.
  1682.         Describe mode       Describe current mode's variable settings and 
  1683.                             bindings.
  1684.         Change Mode…        Change the current mode.
  1685.  
  1686.     Set Font Tabs…          Change font and/or tabs for current file.
  1687.     Special Keys…           Set key bindings for electric features.
  1688.     Describe Binding…       Wait for a keystroke, then display that keystroke's 
  1689.     List Packages           List all installed packages.
  1690.     List All Bindings       List all current key bindings.
  1691.     List Global Bindings (option) List all current global key bindings.
  1692.     List Functions          List all functions currently defined, both
  1693.                             "core" functions (those coded in C), and those
  1694.                             coded in the supplied Tcl files.
  1695.     View Saved Settings…    Any variables or flags that you modify during
  1696.                             the course of a session are saved to files in the 
  1697.                             system preferences folder when Alpha quits. 
  1698.                             This function shows all such saved variables.
  1699.     Remove Saved Settings…  This function allows settings to be removed.
  1700.  
  1701.     Redefine Colors->       See Coloring.
  1702.             
  1703. Windows (an icon with three windows)
  1704.     Zoom                    Zoom windows in and out.
  1705.     Default Size (option)   Resize window to default size.
  1706.     Choose A Window         Choose window to select from list (proc 
  1707.                             chooseAWindow).
  1708.     Iconify                 Toggle iconification of front window.
  1709.     Arrange->               Rearrange open windows.
  1710.  
  1711.     Split Window            Split window into two panes, or unsplit.
  1712.     Toggle Scrollbar        Toggle the horizontal scrollbar on the frontmost 
  1713.                             window. 
  1714.  
  1715.         Installing New Packages
  1716.         
  1717. Where to find new packages
  1718.  
  1719. Currently the best place to look for new packages is 
  1720. <ftp://ftp.ucsd.edu/pub/alpha/>.
  1721. For those from Europe, you may wish to try the mirror: 
  1722. <ftp://anu.theologie.uni-halle.de/comp/mac/Alpha>
  1723.  
  1724. Using the menu "Config->Packages->Internet Updates" Alpha can download and
  1725. automatically install packages for you.
  1726.  
  1727. [to be continued]
  1728.  
  1729. What is already installed?
  1730.  
  1731. It is obviously a waste of time to install something which is already 
  1732. installed or - worse - to install an old package replacing a more recent 
  1733. version. The menu item "Config->List Packages" lists all packages which are 
  1734. installed. The list contains the package names, versions, and maintainers.
  1735.  
  1736. If there is no read me file accompanying the package you are about to 
  1737. install, you can find the version number in the beginning of the tcl file. 
  1738. Look for a line of one of the forms:
  1739. alpha::extension <name> <version> ...
  1740. alpha::menu <name> <version> ...
  1741. alpha::mode <name> <version> ...
  1742. Make a sure the number given by <version> is higher than the one for the 
  1743. currently installed package.
  1744.  
  1745. Installing
  1746.  
  1747. How to start the installation depends on if the package you are about to 
  1748. install is accompanied by a file 'READ ME TO INSTALL' (or similar) or is 
  1749. just a single file someName.tcl.
  1750. • If there is a file 'READ ME TO INSTALL', open it (hence the name!). All 
  1751. packages built up of more than one file must actually have such a read me 
  1752. file in order to be possible to install. If there is a file 
  1753. installScript.tcl (or similar), don't open it. It only contains 
  1754. instructions to Alpha what to install.
  1755. • If there is only a single file someName.tcl, open it. Some single file 
  1756. package are configured to automatically close themselves and open a 
  1757. installation dialog. Otherwise proceed as below.
  1758.  
  1759. If there are instructions in the read me file how to install the package, 
  1760. follow them (of course!). In other cases this is how a typical installation 
  1761. is made.
  1762. • After you have open the read me file or the single someName.tcl, make 
  1763. sure Alpha has inserted a menu 'Install' in the menu bar. This means Alpha 
  1764. is in installation mode. If not, you can manually switch to installation 
  1765. mode by selecting 'Inst' in the mode popup menu in the statusbar.
  1766. • Select 'Install This Package' from the Install menu.
  1767. • An installation dialog is now opened. Here you can choose to make an Easy 
  1768. Install or a Custom Install. The Custom Install lets you choose exactly 
  1769. what to install. The Easy Install installs everything. If you are not sure 
  1770. which files you need use the Easy Install. 
  1771. • There are also two options in the installation dialog.
  1772. If 'Backup removed files' is checked Alpha will save any removed file in a 
  1773. folder InstallationBackup in Alpha's folder. This as a safety measure so 
  1774. you can recover any changes you may have made to them or so you can switch 
  1775. back to them if the newly installed package doesn't work as you wish.
  1776. If 'Show installation log' is checked a window is opened after 
  1777. installation showing which files have been put where and which files have 
  1778. been deleted.
  1779.  
  1780. After Alpha has put the files in there correct location Alpha rebuilds its 
  1781. index files. This make take a little while. The index files are used by 
  1782. Alpha to keep track of where the various packages and function are.
  1783.  
  1784. After the installation is completed you must quit and restart Alpha.
  1785.  
  1786. If something goes wrong
  1787.  
  1788. What to do if you're unlucky and have installed a package which simply
  1789. doesn't work, possibly crashing Alpha when it's launched? The obvious thing
  1790. is then to uninstall the package. If Alpha can be launched with the new
  1791. package installed you can uninstalling it using the method in the next
  1792. section.
  1793.  
  1794. If the newly installed package causes Alpha to crash when you launch it,
  1795. the situation is more problematic. Then you have to manually delete some
  1796. files to make Alpha run again. First delete the files you've just
  1797. installed. During the installation the package's files are copied to
  1798. various locations in the folder "Tcl" inside Alpha's folder. Locate and
  1799. delete the ones with the same names as the ones in the set of files you
  1800. installed. Then before you launch Alpha again you have to delete a folder
  1801. from Alpha's preferences folder. Alpha's preferences folder is called
  1802. "Alpha-v7" and is located in the Preferences folder in the system folder.
  1803. Delete the folder "Cache" inside "Alpha-v7". Deleting the folder "Cache" is
  1804. harmless. It will be re-created the next time you launch Alpha. It is very
  1805. likely, though, that the old content was causing Alpha to crash.
  1806.  
  1807. If this doesn't help, as a last way out try removing the complete
  1808. "Alpha-v7" from the Preferences folder.
  1809.  
  1810.  
  1811.         Uninstalling Packages
  1812.  
  1813. Many packages support a mechanism for uninstalling them. Please note before 
  1814. starting to uninstall packages you think you won't ever need that the only 
  1815. thing you save by uninstalling a package is disk space - unless you have 
  1816. installed some buggy package causing obvious problems. Installed packages 
  1817. which are not in use, i.e. either not enabled through the dialog 'Menus and 
  1818. Features' or modes which are not used, are never loaded into Alpha's 
  1819. memory. Thus you do not save any memory by uninstalling packages. Thus if 
  1820. you have plenty of disk space, there is hardly any point in uninstalling 
  1821. anything.
  1822.  
  1823. Uninstalling a package in done using the menu item
  1824. "Config->Packages->Uninstall Some Packages". Select the package you want to
  1825. uninstall from the popup menu in the dialog. All files belonging to the
  1826. package are now permanently deleted. Only a reinstallation will restore the
  1827. package.
  1828.  
  1829. After the uninstallation you must restart Alpha.
  1830.  
  1831. If you can't find the package you want to uninstall in the popup menu, it 
  1832. means that the package doesn't support the mechanism for automatic 
  1833. uninstallation. In this case the only way uninstall the package is to 
  1834. manually find the files belonging to the package and delete them. Don't use 
  1835. this method unless you know what you are doing. Deleting the wrong files 
  1836. may result in all sorts of troubles.
  1837.  
  1838.         Changing Alpha's behavior
  1839.         
  1840. The rest of the manual discusses some general topics about how to extend 
  1841. Alpha by writing your own Tcl code.
  1842.  
  1843. First of all, where do you put your own Tcl code so that Alpha can find it?
  1844. Alpha has a set of preferences files for this purpose. There is one global
  1845. preferences file which is loaded when Alpha is launched. In this file you
  1846. should put code which should be loaded regardless of which mode you're
  1847. working in. This preferences file is opened using the menu item
  1848. "Config->Preferences->Edit Prefs File".
  1849.  
  1850. Then there is one preferences file for each mode. The file for a mode is
  1851. loaded after as the last code to be loaded when a mode is used the first
  1852. time. This preferences file is opened using the menu item "Config->Mode
  1853. Prefs->Edit Prefs File".
  1854.  
  1855. These preferences files are intended for code for personal use. If you want 
  1856. to write a complete new package for Alpha, which others also can use, read 
  1857. the file Extending Alpha.
  1858.         
  1859.         ALPHA-D mailing list
  1860.         
  1861. There is mailing list for Alpha where you can discuss problems, suggest new 
  1862. features etc. To subscribe, email <listserv@listserv.syr.edu> and, in the 
  1863. body of your message (not the subject line), write: 
  1864. SUBSCRIBE ALPHA-D
  1865.  
  1866. There are a number of known bugs which will hopefully be corrected in a 
  1867. future release. PLEASE read the Bug Reports and Debugging file for a list 
  1868. of known bugs, and for how to give an informative bug report, without which 
  1869. it is unlikely any bug you found can be fixed.
  1870.         
  1871.         Key bindings
  1872.         
  1873. Any Tcl command can be bound to any single keystroke. One way to bind a 
  1874. function is with a statement such as:
  1875.   
  1876.       Bind 'c' <modifier string> funcName [<mode>]
  1877.           
  1878. where c is a character, <modifier string> is an optional string containing 
  1879. one or more of:
  1880.  
  1881.       c   - command modifier
  1882.       o   - option modifier
  1883.       s   - shift modifier
  1884.       z   - control modifier
  1885.       e   - escape modifier      
  1886.  
  1887. 'mode' is an optional parameter that specifies, when present, that the 
  1888. binding is only active in a given mode. Note that given a general binding 
  1889. (no mode specification) and a binding specific to the current mode, the 
  1890. last binding to have been created is the one found first.
  1891.  
  1892. For example, the following line binds cmd-shift-f to the function 
  1893. 'forwardChar':
  1894.  
  1895.     Bind 'f' <cs> forwardChar
  1896.  
  1897. Additionally, the modifier string can contain a capital letter specifying 
  1898. that the binding is only activated if preceded by control and the lowercase 
  1899. version of that letter. This feature allows multiple-key combinations a la 
  1900. Emacs. This requires that ctrl-<the character> is bound to the function 
  1901. 'prefixChar'. By default ctrl-C, ctrl-Q, and ctrl-X are bound to 
  1902. 'prefixChar'. The next line would bind 'forwardChar' to ctrl-x ctrl-f:
  1903.  
  1904.     Bind 'f' <cX> forwardChar 
  1905.  
  1906. Additionally, most keyboards have keypads and/or function keys. These 
  1907. keys can be bound using case-insensitive numeric labels using the same 
  1908. bind command as above, with the label replacing the character. For 
  1909. example, to bind F1 to function 'funcName', the following would work:
  1910.  
  1911.     Bind F1 funcName
  1912.  
  1913. As above, the binding can include a modifier string. The following labels 
  1914. are defined:
  1915.  
  1916.   Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 Help Home Pgup Del 
  1917.   End Pgdn Left Right Up Down Clear Kpad0 Kpad1 Kpad2 Kpad3 Kpad4 Kpad5
  1918.   Kpad6 Kpad7 Kpad8 Kpad9 Kpad= Kpad/ Kpad* Kpad- Kpad+ Enter Kpad.
  1919.  
  1920. The above labels may not be sufficient for all keyboards (attention
  1921. international users). In particular there are some problems when binding to
  1922. accented characters (more about that below). If a hex number is used
  1923. instead of a character inside the single quotes, the binding is done to key
  1924. codes instead of ascii values. The following is a key code version of the
  1925. same binding:
  1926.  
  1927.     Bind 0x03 <cs> forwardChar
  1928.  
  1929. The key code for any given key can be obtained by selecting the menu item 
  1930. "Utils->Ascii Etc->Key Code" and then typing the key. Alpha then types the 
  1931. key code.
  1932.  
  1933. Also, there is an alternate form that allows the specification of an 
  1934. ascii code directly:
  1935.  
  1936.     ascii 0x20 <z> setMark
  1937.     
  1938. Binds control-space to 'setMark'. The ascii code for any given key can be 
  1939. obtained by selecting the menu item "Utils->Ascii Etc->Key Ascii" and then 
  1940. typing the key. Alpha then types the ascii code.
  1941.  
  1942. Note that menu item command equivalents take precedence over bindings, and 
  1943. that the 'Bind' command does not affect the command equivalents displayed 
  1944. in the menus. Also note that key code bindings take precedence over ascii 
  1945. bindings.
  1946.  
  1947. Finally, there are 'unBind' and 'unascii' functions, with identical 
  1948. arguments to their counterparts. 
  1949.  
  1950. Bindings to accented characters
  1951.  
  1952. To bind to an accented character is not always as straight forward as 
  1953. binding to an un-accented one. 
  1954.  
  1955. Accented characters which can be typed directly without using a dead key, 
  1956. you can bind to them as long as they have a modifier different from <s>. As 
  1957. an example with a French keyboard
  1958.  
  1959.     Bind 'é' <c> ...
  1960.     Bind 'é' <z> ...
  1961.     
  1962. works fine, but
  1963.  
  1964.     Bind 'é' ...
  1965.     Bind 'é' <s> ...
  1966.     
  1967. does not. In the latter case the key code has to be used instead:
  1968.  
  1969.     Bind 0x13 ...
  1970.     Bind 0x13 <s> ...
  1971.  
  1972. Accented characters which are obtained using a dead key has to be bound 
  1973. using ascii, e.g 'ì' on a French keyboard:
  1974.  
  1975.     ascii 0x93 ...
  1976.  
  1977. What to bind to?
  1978.  
  1979. When you want to define a new key binding you obviously want to use a key
  1980. combination which is not already in use. There are two different ways to
  1981. find if a key combination is free. 
  1982.  
  1983. First, the menu item "Config->List All Bindings" will list all of the
  1984. bindings currently in effect.
  1985.  
  1986. Second, you can use "Config->Describe Binding" to find what a certain key
  1987. combination is bound to. Select "Config->Describe Binding" and then hit the
  1988. key combination you are interested in. Alpha will then display a dialog
  1989. saying which function the key combination is bound to, or "Key combination
  1990. unbound." if it is not bound to anything. 
  1991.  
  1992. There is one thing to note about bindings involving the shift key. If there
  1993. is nothing bound to a key combination including the shift key, typing this
  1994. key combination will have the same effect as the one wihout the shift key.
  1995. A specific example to clarify this: command-P is bound to "print", but
  1996. there is no binding defined for command-shift-P. Still hitting
  1997. command-shift-P has the same effect as hitting command-P. But if you now
  1998. define a new binding for command-shift-P, then command-P and
  1999. command-shift-P will have different functionality.
  2000.  
  2001.         Menus, user-defined
  2002.         
  2003. If you want to make your own menu with your personal Tcl functions, this 
  2004. section explains how to do it. If you want to add new menu items to the 
  2005. existing menus, see the next section for instructions. However, in that 
  2006. case you also need to read this section.
  2007.  
  2008. Alpha's menu commands allow the user to build custom menus which contain
  2009. names of functions, macros, or arbitrary TCL commands that just HAVE to be
  2010. in the menus, as opposed to being merely callable through the bindings. The
  2011. menu items are defined as a list of strings. The following meta characters
  2012. can be embedded in the strings:
  2013.  
  2014.    Meta-character     Usage
  2015.    --------------     -----
  2016.  
  2017.     ; or Return       Separates multiple items.
  2018.     ^                 Followed by an icon number, adds 
  2019.                       that icon to the item.
  2020.     !                 Followed by a character, marks the
  2021.                       item with that character.
  2022.     <                 Followed by B, I, U, O, E, or S,  
  2023.                       sets the character style of the item.
  2024.     /                 Followed by a character, sets up
  2025.                       a keyboard equivalent.
  2026.     (                 Disables the item. Use (- to get a 
  2027.                       separator line.
  2028.  
  2029. The following modifiers can be used to require other combinations of 
  2030. modifiers than just the command key. Control-option, for instance, is 
  2031. specified by putting the string "<B<I" in the menu item. The menu symbol 
  2032. for shift is an upward outline arrow, control is the outlined ^ symbol 
  2033. ("Wins->Iconify" has one), and option is the wavy line with the dot in the 
  2034. upper right ("Search->Replace All" has one). The following are characters 
  2035. that can follow the '<' and what they signify.
  2036.  
  2037.     B       - control key required
  2038.     I       - option key required
  2039.     U       - shift key required (only for alpha-numerics!)
  2040.     O       - command key required
  2041.     S       - is part of a dynamic item.
  2042.     E       - forces item to start new dynamic item.
  2043.  
  2044.  
  2045. A '/' followed by a character in the left column sets up a keyboard 
  2046. equivalent for the key in the right column:
  2047.  
  2048.     a   Enter           n   F10
  2049.     b   Return          o   F11
  2050.     c   Tab             p   F12 
  2051.     d   Num Lock        q   F13
  2052.     e   F1              r   F14
  2053.     f   F2              s   F15
  2054.     g   F3              t   Help
  2055.     h   F4              u   Del
  2056.     i   F5              v   Forward Del
  2057.     j   F6              w   Home
  2058.     k   F7              x   End
  2059.     l   F8              y   Page Up
  2060.     m   F9              z   Page Down
  2061.     
  2062. The menu creation syntax is :
  2063.  
  2064.     Menu [-s] <-n name> <-i num> [-p procName] [-m] [-M <mode>] "Tcl list of menu items"
  2065.  
  2066. Where the arguments have the followings meanings:
  2067.   -s            Use system menu definition proc (faster).
  2068.   -i <num>      Resource id of icon suite to use for menu title.
  2069.   -n <name>     Name of menu.
  2070.   -m            No menu form. If not supplied, each menu item is split into 
  2071.                 words at each capitalized letter.
  2072.   -p <pname>    Rather that having alpha call a Tcl proc named by the menu 
  2073.                 item's text, this option tells Alpha to call the tcl proc 
  2074.                 named by 'pname' with two arguments: the menu name, and the
  2075.                 text of the menu item chosen.
  2076.   -M <mode>     Bindings only take effect in specified mode.
  2077.   
  2078. The 'Tcl list of menu items' can include another menu definition allowing 
  2079. you to create hierarchical menus. Once the menus are created, they can be 
  2080. inserted and deleted from the menu bar by the syntax:
  2081.  
  2082.    insertMenu "name"
  2083.    removeMenu "name"
  2084.  
  2085. As alluded to above, Alpha attempts to make procedure names readable in the 
  2086. menus by separating words at any capitalized letter. For example, 
  2087. 'findFile' becomes "Find File". This function is turned off by the '-m' 
  2088. option. 
  2089.  
  2090. Menu items can be enabled and disabled through the TCL command 
  2091. 'enableMenuItem'. Menu items checkmarks can be turned on and off via 
  2092. 'markMenuItem'. Menu items can be appended via 'addMenuItem' and deleted 
  2093. via 'deleteMenuItem'. See the "Alpha Commands" help file for syntax.
  2094.  
  2095. As explained above, Alpha uses various keys to specify text style and key 
  2096. equivalents. Sometimes you may want these characters included in your text 
  2097. literally. If an ampersand ('&') is the last character in a menu item, 
  2098. these special characters are not interpreted.
  2099.  
  2100. If an ellipsis ('…') is the last character in a menu item (except possible 
  2101. for the above ampersand), it is stripped off before searching for the 
  2102. function corresponding to the chosen item.
  2103.  
  2104.         Modifying Alpha's menus
  2105.         
  2106. Alpha's global menus and most mode menus can be modified using commands
  2107. menu::insert, menu::removeFrom, and menu::replaceWith. The use of these are
  2108. explained in the section Adding items to global menus in the file Extending
  2109. Alpha.
  2110.  
  2111.         Event hooks
  2112.         
  2113. When certain events occur. e.g. when opening and closing windows, Alpha 
  2114. calls an event hook. You can register your own event hooks to add to the 
  2115. default behavior when the corresponding event occurs. Below is a table of 
  2116. all available hooks. 
  2117.  
  2118. To add your own hook there are two things you have to do. First write a 
  2119. proc to be called when some events occurs. This proc must have the 
  2120. parameters shown in the table. Lets say you want to define a saveHook. 
  2121. Then define some proc
  2122.  
  2123.     proc mysaveHook {name}{
  2124.         .
  2125.         .
  2126.     }
  2127.     
  2128. The next thing you have to do is to register the proc. This is done with a 
  2129. line like:
  2130.  
  2131.     hook::register 'hook-name' 'your proc' 'mode' ?... 'mode'?
  2132.  
  2133. The optional mode parameters specify in which modes the hook will be 
  2134. called. If no mode parameters are given the hook will be called regardless 
  2135. of the mode. Avoid this unless absolutely necessary.
  2136.  
  2137. Let's assume that you want your hook to be called in TeX and Perl modes. 
  2138. To register it you would use the line:
  2139.  
  2140.     hook::register saveHook mysaveHook TeX Perl
  2141.  
  2142. Note, however, that a few hooks doesn't use the mode to determine when to 
  2143. be called and should be registered slightly differently, see below.
  2144.     
  2145. Window hooks
  2146.   Hook                                              Parameter(s)
  2147. • activateHook                                      path to file
  2148.   Called when a window is brought to front
  2149. • deactivateHook                                    path to file
  2150.   Called when a window is sent to back
  2151. • openHook                                          path to file
  2152.   Called when a window is opened
  2153. • closeHook                                         path to file
  2154.   Called when a window is closed
  2155. • saveHook                                          path to file
  2156.   Called when a window is saved
  2157. • saveasHook                                        path to old file, path to new file   
  2158.   Called when a window is saved as
  2159. • savePostHook                                      path to file
  2160.   Called after a window is saved
  2161.   
  2162. Alpha hooks
  2163.   Hook                                              Parameter(s)
  2164. • startupHook
  2165.   Called at the end of startup
  2166. • quitHook
  2167.   Called when quitting Alpha
  2168. • suspendHook                                       an empty string
  2169.   Called when switching to another app
  2170. • resumeHook                                        an empty string
  2171.   Called when switching to Alpha from another app
  2172.   
  2173. Mode hooks
  2174.   Hook                                              Parameter(s)
  2175. • mode::init
  2176.   Called the first time a mode is loaded
  2177. • changeMode                                        new mode
  2178.   Called when the mode is changed
  2179. • dialog::modifyModeFlags                           a string (title of dialog)
  2180.   Called after a mode prefs dialog is closed
  2181. • mode::editPrefsFile
  2182.   Called when a mode prefs file is opened 
  2183.   for editing
  2184.   
  2185. Keyboard hooks
  2186.   Hook                                              Parameter(s)
  2187. • keyboard
  2188.   Called at startup and when the keyboard prefs 
  2189.   is changed
  2190. • removekeyboard
  2191.   Called when the keyboard prefs is changed
  2192.   
  2193. The keyboard hooks use the keyboard name (the ones in the keyboard popup menu 
  2194. in the International preferences dialog) rather than the mode to determine 
  2195. when to be called. Thus to register a keyboard or removekeyboard hook use 
  2196. lines like:
  2197.  
  2198.     hook::register 'hook-name' 'your proc' 'keyboard name' ?... 'keyboard name'?
  2199.  
  2200. Miscellaneous hooks
  2201.   Hook
  2202. • launch
  2203.   Called when a helper app is launched by calling app::ensureRunning
  2204.   
  2205. The launch hook uses the application signature rather than the mode to 
  2206. determine when to be called. Thus to register a launch hook use a line like:
  2207.  
  2208.     hook::register launch 'your proc' 'signature' ?... 'signature'?
  2209.  
  2210. • requireOpenWindowsHook    
  2211.   Called when opening and closing windows.
  2212.  
  2213. This hook is used to en-/disable meaningless menu items which would require 
  2214. the presence of a certain number of windows to be active. You can register 
  2215. your own menu items using a line like:
  2216.  
  2217.     hook::register requireOpenWindowsHook [list menu item] N
  2218.  
  2219. where 'N' is the number of windows required (1 or 2 usually)
  2220.  
  2221. As an example, this is a line from Diff mode registering the item 'Compare 
  2222. Windows' to require 2 open windows to be enabled.
  2223.  
  2224.     hook::register requireOpenWindowsHook [list compare windows] 2
  2225.  
  2226.         modeCreator
  2227.  
  2228. The modeCreator array allow you to tell Alpha which mode to choose when you 
  2229. open a window depending on which application has created the file. Add to 
  2230. this array with lines like:
  2231.  
  2232.     set modeCreator(<signature>) <mode>
  2233.     
  2234. 'Signature' is the signature of the application which has created the file 
  2235. and 'mode' is the mode which you want Alpha set for the window. For 
  2236. example, to open all files created by Netscape in HTML mode use the line:
  2237.  
  2238.     set modeCreator(MOSS) HTML
  2239.     
  2240. Tip: To find the signature of an application, launch it, open the Tcl 
  2241. shell (command-Y) and type 'ps' at the prompt. This will list all running 
  2242. applications; the second column lists the signatures.
  2243.  
  2244.         unixMode
  2245.  
  2246. When you open unix files where the first non-empty line reads 
  2247. '#!/dir/subdir/command ...' then Alpha tries to find a mode corresponding to 
  2248. 'command'. With the unixMode array you can tell Alpha which mode to choose 
  2249. when opening such a file. Add to this array with lines like:
  2250.  
  2251.     set unixMode(<command>) <mode>
  2252.     
  2253. where 'command' is the command in the line '#!/dir/subdir/command ...' and 
  2254. 'mode' is the mode which you want Alpha set for the window. For example, to 
  2255. make Alpha open files with a line '#!/dir/subdir/perl ...' in Perl mode use 
  2256. the line:
  2257.  
  2258.     set unixMode(perl) Perl
  2259.  
  2260.         Word breaking
  2261.         
  2262. Alpha allows you to redefine its internal notion of what a word is, through 
  2263. the preferences 'Word Break', and 'Word Break Preface'. 'Word Break' is set 
  2264. to a regular expression that defines a word to you. 'Word Break Preface' 
  2265. should be a regular expression that matches exactly one of any characters 
  2266. that are not in your word definition.
  2267.  
  2268. The value of 'Word Break' and 'Word Break Preface' are mode dependent, as 
  2269. what is meant by a word may be different for different types of text. For 
  2270. example, in Text mode the default definition of 'Word Break' is '\w+'. This 
  2271. matches any contiguous sequence of contiguous alphanumeric characters.
  2272.  
  2273. The default value in Text mode for 'Word Break Preface' is '(\W)', 
  2274. basically just the negation of any any of the characters in your 'Word 
  2275. Break' definition.
  2276.  
  2277. The need for both these variables in backward searches can be seen as 
  2278. follows. Suppose your window's text is 'hey hello', and the current 
  2279. insertion is between the two 'l's. Now, searching backwards for the above 
  2280. 'Word Break' definition will take the insertion to between the 'e' and the 
  2281. first 'l', not really where we want to say is the start of the word. By 
  2282. contrast, if we search backwards for 'Word Break Preface' and 'Word Break' 
  2283. concatenated together, and then move forward one character after a 
  2284. successful search, we end up right before the 'h' in 'hello', just where we 
  2285. want to be.
  2286.  
  2287. There are also two similar preferences 'Wrap Break' and 'Wrap Break 
  2288. Preface' used for automatic word wrapping. In Text mode their default 
  2289. values are '[\w_]+' and '([^\w_])' meaning that wrapping should not occur 
  2290. between alphanumeric characters or underscore.
  2291.  
  2292.